Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Save Multiple Treatments (extends) for a Subject (using refback to treatment) #3670

Closed
Fernananas opened this issue Apr 26, 2024 · 1 comment · Fixed by #3731 or #3768
Closed
Assignees
Labels
bug Something isn't working ern priority Features/bugs that we should not let wait
Milestone

Comments

@Fernananas
Copy link

What version of EMX2 are you using (see footer)
Software version: v10.58.0

Describe the bug
I encountered an issue while attempting to save information for multiple treatments associated with a subject in EMX2. Here's the scenario:

  1. I have a subject in the database.
  2. There are multiple questions regarding treatment for different conditions, such as epilepsy and delayed puberty.
  3. I used an "extend" to specify treatment, with each question linking back to the "extendTreatment" entity.
  4. When attempting to save information for more than one treatment for a patient, I encountered the following error:
  5. failed.: Transaction failed: SQL [update "extendTreatment"."rasopathies" set "belongsToSubject" = 'test', "subTypeRasopathy" = 'schwannomatosis', "prenatalImaging" = 'na', "abnormalThyroid" = 'hyper', "abnormalThyroidTreatment" = cast('{"d994a6d1-aa3a-493c-8f11-3f0c23b337d1"}' as varchar[]), "diabetes" = 'yes', "diabetesTreatment" = cast('{"b9675a4e-9c7c-4e93-8bf1-d6021bdc2312"}' as varchar[]), "linkToAuxology" = cast('{"b059f962-84df-417a-a5f1-8f2d2566714a"}' as varchar[]), "delayedPuberty" = 'yes', "delayedPubertyTreatment" = cast('{"97d49ca1-debe-4e45-a932-a25b3f13cf19"}' as varchar[]), "intellectualDisability" = 'na', "abnormalHeartMorphology" = 'no', "cardiomyopathy" = cast('{"no"}' as varchar[]), "lymphaticAnomaly" = 'no', "deafnessHearingImpairment" = 'no', "label" = 'schwannomatosis', "mg_draft" = false, "mg_updatedBy" = 'admin', "mg_updatedOn" = timestamp '2024-04-26 11:28:55.939786961' where "id" = '6ebb5c1f-4280-48b2-84b4-e11fea8f6a24']; Batch entry 0 update "extendTreatment"."rasopathies" set "belongsToSubject" = 'test', "subTypeRasopathy" = 'schwannomatosis', "prenatalImaging" = 'na', "abnormalThyroid" = 'hyper', "abnormalThyroidTreatment" = cast('{"d994a6d1-aa3a-493c-8f11-3f0c23b337d1"}' as varchar[]), "diabetes" = 'yes', "diabetesTreatment" = cast('{"b9675a4e-9c7c-4e93-8bf1-d6021bdc2312"}' as varchar[]), "linkToAuxology" = cast('{"b059f962-84df-417a-a5f1-8f2d2566714a"}' as varchar[]), "delayedPuberty" = 'yes', "delayedPubertyTreatment" = cast('{"97d49ca1-debe-4e45-a932-a25b3f13cf19"}' as varchar[]), "intellectualDisability" = 'na', "abnormalHeartMorphology" = 'no', "cardiomyopathy" = cast('{"no"}' as varchar[]), "lymphaticAnomaly" = 'no', "deafnessHearingImpairment" = 'no', "label" = 'schwannomatosis', "mg_draft" = false, "mg_updatedBy" = 'admin', "mg_updatedOn" = timestamp '2024-04-26 11:28:55.939786961' where "id" = '6ebb5c1f-4280-48b2-84b4-e11fea8f6a24' was aborted: ERROR: column "belongsToRASopathy" of relation "treatmentabnormalThyroid" does not exist Where: PL/pgSQL function "extendTreatment"."1rasopathies-abnormalThyroidTreatment_UPDATE"() line 16 at SQL statement Call getNextException to see other errors in the batch..
    This error prevents me from saving data for multiple treatments for the same subject. It seems that there's a limitation or inconsistency in the database schema or data linkage that is causing this issue. Added treatments are visible in treatment tables.

To Reproduce
Steps to reproduce the behavior:

  1. Create test database
  2. Upload datamodel with additional ontologies (and dataprovider (optional))
  3. Go to "/tables/#/Rasopathies"
  4. Create dummy patient info (fill in all mandatory fields)
  5. add two treatments, go to 'growth &GH', add 'yes' in question Abnormal thyroid function.
  6. add 'treatmentabnormalThyroidFunction'
  7. add 'yes' in question 'Diabetes'
  8. add 'treatmentDiabetes'
  9. See error

Expected behavior
I should be able to save information for multiple treatments associated with a subject without encountering any errors. The database schema and data linkage should support this functionality seamlessly.

Screenshots
Scherm­afbeelding 2024-04-26 om 11 26 58
ontology1714124552335.zip

dashboard_data.zip
extendTreatment1714125348515.zip

@Fernananas Fernananas added bug Something isn't working ern priority Features/bugs that we should not let wait labels Apr 26, 2024
@mswertz mswertz added this to the Sprint 221 milestone May 6, 2024
@chinook25 chinook25 self-assigned this May 13, 2024
@chinook25
Copy link
Contributor

chinook25 commented May 13, 2024

I can't create a schema using the provided data, there might be some errors in de zip files.
Edit: solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ern priority Features/bugs that we should not let wait
Projects
None yet
3 participants