Closed alanwilter closed 3 years ago
Hi:
I have changed the front to return "U" when sex was chosen as "Unknown". See below screenshot. However, I noticed if it send "U", the updating is not successful. I guess you will change the backend to make it work right?
I will merge now.
Also, do you need "U" sending for Consanguinity?
No.
"individual_consanguinity_check" CHECK (consanguinity = ANY (ARRAY['yes'::text, 'no'::text, 'unknown'::text]))
"individual_sex_check" CHECK (sex = ANY (ARRAY['M'::text, 'F'::text, 'N'::text, 'U'::text]))
It's not working in dev-live neither in my branch tests.
@YuanTian1991 I found that in frontend/src/components/CreatePatient/InformationForm.js
, line 227:
Replace:
<Grid item xs={3}>
<FormControlLabel
value="unknown"
control={<Radio color="primary" />}
label="Unknown"
labelPlacement="Unknown"
/>
</Grid>
for
</Grid>
<Grid item xs={3}>
<FormControlLabel
value="U" // <--- change here
control={<Radio color="primary" />}
label="Unknown"
labelPlacement="Unknown"
/>
</Grid>
solves the issue in http://localhost:8888/create_patient
(The create patient page), but I didn't commit any change.
However I couldn't solve the issue in the "Edit Patient Page", e.g., http://localhost:8888/editpatient/PH00008256#info
. If change sex for a patient to Unknown
, it triggers the error. I tried several things in frontend/src/components/Individual/EditPerson.js
(which I'm not even sure if this file is used) and couldn't find out why the frontend still sends unknown
instead of U
to the backend.
I also tried with
frontend/src/components/EditPatient/InformationUpdate.js
and
frontend/src/components/UpdatePatient/InformationUpdate.js
BTW, why these two almost identical files? I'm quite sure we are not using one of them (I'd bet on the former, in UpdatePatient folder). It would be good to the frontend code from redundant/unused files.
At the end I got quite confused with JS, I could even use debug in VScode and Firefox, but I couldn't fix your code.
So you need to be sure that create and change/updating patient is fully working.
Hold on, I found something weird on the back end, def create_individual():
and def update_patient_data(phenopolis_id):
are not using the same definition for sex unknown
. Let me check this first.
Frontend should send 'U' instead of 'unknown'.