ohcnetwork / care_fe

Care is a Digital Public Good enabling TeleICU & Decentralised Administration of Healthcare Capacity across States.
https://care.ohc.network
MIT License
249 stars 432 forks source link

Occupation of patient to be tracked #6945

Closed aparnacoronasafe closed 7 months ago

aparnacoronasafe commented 10 months ago

https://care.coronasafe.in/facility/eeb23cb7-1524-479a-825e-660311386b47/patient/51ff0682-065d-4e25-bcc6-fb1b682642fb/update

Patient registration form, add a field at the bottom of the "Personal details" section for "Occupation", with dropdown with the following options: "Student/ Businessman/ Health care worker/Health care lab worker/ animal handler/ any other"

sagarkori143 commented 10 months ago

I would like to take this one!

sagarkori143 commented 10 months ago

@aparnacoronasafe

Should this field also be marked as mandatory? And are these options okay and sufficient? image

sagarkori143 commented 10 months ago

Also @rithviknishad @aparnacoronasafe @nihal467 @AshrafMd-1 I have created the required Occupation field and I inspected results in console and ensured that the occupation data is going through handleSubmit process but this data is not being saved into the database because when I again go to edit patient after submitting all the details, the occupation field there is again empty. Here is what I have done so far: 1) Defined OCCUPATION_TYPES in Constants.tsx image

2) Defined occupation modal as strings in models.tsx image

3) Added occupation input field in patientRegister.tsx image

4) Added to Abha linking image

image

5) Added to data schema in handleSubmit: image

6) Defined in fetchExtResultData in patientReg.tsx itself: image

Please have a look and let me know where I'm missing out which is resulting in data not being saved to database.

rithviknishad commented 10 months ago

The backend does not have a field called "occupation" in the patient serializer.

Kindly go through the README and have a look at the Care API Docs https://careapi.ohc.network/swagger/

The occupation field is available inside the meta field of the patient serializer.

Also, this will require backend changes to be made to support the new options.

image
rithviknishad commented 10 months ago

@aparnacoronasafe should the "any other" option be a free-flow text accepting any input from the user?

github-actions[bot] commented 9 months ago

Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, @aparnacoronasafe, This issue has been automatically marked as stale because it has not had any recent activity.

konavivekramakrishna commented 9 months ago

@rithviknishad

can you please assigne me

konavivekramakrishna commented 9 months ago

@rithviknishad

in patientregistration table there is no field occupation instead in patientmetainfo table occupation is present but the options are different should i add a new field to patientregistration table or change options in patientmetainfo table image

konavivekramakrishna commented 9 months ago

@rithviknishad

image

in patientmetainfo there no records, should i add occupation field in patientregistration table ?

rithviknishad commented 9 months ago

The meta_info field may not being used in the current version of care_fe. But the backend already has it working. We do have 21 records in meta_info table in staging.

You can just update the enum choices

image
konavivekramakrishna commented 9 months ago

@sainak

when i am trying to load dummy data, I am getting the below error can you please help me to fix this

image image

konavivekramakrishna commented 9 months ago

image

should i add video_connect_link field to each user in dummy data to fix this ?

sainak commented 9 months ago

seems like a migration is pending, can you pull the latest changes and restart the containers

konavivekramakrishna commented 9 months ago

No changes have been made, and I have restarted the containers, but It's still showing the same error

rithviknishad commented 9 months ago

@konavivekramakrishna wait for the migrations to complete before running load_dummy_data

Same issue reported here: https://github.com/coronasafe/care/issues/1833

konavivekramakrishna commented 9 months ago

Thanks, @sainak and @rithviknishad

The issue has been fixed now