import { Body, Controller, Get, Patch, Post, Query } from "@nestjs/common";
import { PatientprofileService } from "./patient-profile.service";
import { ABHAProfile, Patientprofile } from "./entities/patient-profile.entity";

@Controller("patientprofile")
export class PatientprofileController {
  constructor(private readonly patientprofileService: PatientprofileService) {}

  @Get()
  async getPatientDetails(
    @Query("patientId") patientId: number,
    @Query("hospital_id") hospital_id: number
  ) {
    return this.patientprofileService.getPatientDetails(patientId, hospital_id);
  }

  @Patch()
  updateStatus(
    @Query("patientId") patientId: number,
    @Body() Entity: Patientprofile,
    @Query("hospital_id") hospital_id: number
  ) {
    return this.patientprofileService.updatePatientDetails(
      patientId,
      Entity,
      hospital_id
    );
  }

  @Patch("/abha-address")
  updateabhaAddress(
    @Query("patientId") patientId: number,
    @Body() Entity: Patientprofile,
    @Query("hospital_id") hospital_id: number
  ) {
    return this.patientprofileService.updatePatientABHAaddress(
      patientId,
      Entity,
      hospital_id
    );
  }

  @Patch("/abha-number")
  updateabhaNumber(
    @Query("patientId") patientId: number,
    @Body() Entity: ABHAProfile,
    @Query("hospital_id") hospital_id: number
  ) {
    return this.patientprofileService.updatePatientABHANumber(
      patientId,
      Entity,
      hospital_id
    );
  }
  @Patch("/verify-abha-number")
  updateVerifyabhaNumber(
    @Query("patientId") patientId: number,
    @Body() Entity: ABHAProfile,
    @Query("hospital_id") hospital_id: number
  ) {
    return this.patientprofileService.updatePatientVerifyABHANumber(
      patientId,
      Entity,
      hospital_id
    );
  }
  @Post("/get-registration-status")
  getRegistrationStatus(
    @Body() Entity: any,
    @Query("hospital_id") hospital_id: number
  ) {
    return this.patientprofileService.getRegistrationStatus(
      Entity,
      hospital_id
    );
  }

  @Patch("/update-abha-number")
  updateOnlyABHANumber(
    @Query("aayush_unique_id") aayush_unique_id: any,
    @Query("abhaNumber") abhaNumber: any,
    @Query("hospital_id") hospital_id: number
  ) {
    return this.patientprofileService.updateOnlyABHANumber(
      aayush_unique_id,
      abhaNumber,
      hospital_id
    );
  }
}
