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

Map single entry symptom responses to FHIR #8183

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

emyl3
Copy link
Collaborator

@emyl3 emyl3 commented Oct 10, 2024

BACKEND PULL REQUEST

Related Issue

Changes Proposed

  • Maps single entry symptom responses to FHIR to match the format described here
{
    "fullUrl": "Observation/12345",
    "resource": {
        "resourceType": "Observation",
        "id": "12345",
        "identifier": [
            {
                "use": "official",
                "type": {
                    "coding": [
                        {
                            "system": "http://loinc.org/",
                            "code": "99582-9",
                            "display": "Symptom and timing panel"
                        }
                    ]
                }
            }
        ],
        "status": "final",
        "code": {
            "coding": [
                {
                    "system": "http://loinc.org/",
                    "code": "75325-1",
                    "display": "Symptom"
                }
            ],
            "text": "Symptom"
        },
        "subject": {
            "reference": "Patient/12345"
        },
        "valueCodeableConcept": {
            "coding": [
                {
                    "system": "http://snomed.info/sct",
                    "code": "111516008",
                    "display": "Blurred vision"
                }
            ]
        }
    }
}

Additional Information

  • N/A

Testing

@@ -802,7 +807,7 @@ private void addCorrectionNote(
}
}

public Set<Observation> convertToAOESymptomObservation(
public Set<Observation> convertToAOESymptomaticObservation(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ renamed it to be more accurate with the observation we are adding

@@ -51,6 +51,8 @@ private FhirConstants() {

public static final String LOINC_AOE_IDENTIFIER = "81959-9";
public static final String LOINC_AOE_SYMPTOMATIC = "95419-8";
public static final String LOINC_SYMPTOM_TIMING_PANEL = "99582-9";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -51,6 +51,8 @@ private FhirConstants() {

public static final String LOINC_AOE_IDENTIFIER = "81959-9";
public static final String LOINC_AOE_SYMPTOMATIC = "95419-8";
public static final String LOINC_SYMPTOM_TIMING_PANEL = "99582-9";
public static final String LOINC_SYMPTOM = "75325-1";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -378,6 +378,51 @@ public static String parseState(String s) {
throw IllegalGraphqlArgumentException.invalidInput(s, "state");
}

private static final Map<String, String> RESPIRATORY_SYMPTOMS =
Copy link
Collaborator Author

@emyl3 emyl3 Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ symptoms taken from this frontend file

separated them out like the frontend -- thought this would make things easier to read and consistent with the frontend

Let me know if you all prefer one map of these symptoms

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic makes sense to me, especially considering that it's how we are making the distinction between symptoms across the rest of the app.

@emyl3 emyl3 force-pushed the elisa/6609-symptoms-fhir-single-entry branch 2 times, most recently from bb0be5d to fa1b9b9 Compare October 10, 2024 18:56
Comment on lines 1008 to 1009
List<String> positiveSymptoms = getPositiveSymptoms(surveyData.getSymptoms());
observations.addAll(convertToSymptomsObservations(positiveSymptoms));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very clean and makes sense to me from a logic perspective. However, does anyone know why we weren't making the distinction between postive and negative symptoms before in the Fhir conversion?

Or was that distinction already being made, just without the helper function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were only adding the "Yes" symptomatic observation if there were true symptom values (see line 973 above)

Since that only checks if any symptom value is true, I needed to create an additional method to return all the symptoms that were true so it's easier to create an Observation for each positive symptom.

Let me know if that makes sense or you see any other optimization! 😸

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a tiny bit unclear - I would have initially assumed Positive and Negative meant that it was a positive or negative test result.

Copy link
Collaborator Author

@emyl3 emyl3 Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rename this and the variable... maybe something like trueSymptoms and getTrueSymptoms
edit: ended up renaming it as getFilteredTrueSymptoms

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I updated this! Let me know if that makes it more clear! 😸

bobbywells52
bobbywells52 previously approved these changes Oct 11, 2024
Copy link
Collaborator

@bobbywells52 bobbywells52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some clarifying questions for myself but overall looks great! Thanks for your work on this

mpbrown
mpbrown previously approved these changes Oct 15, 2024
Copy link
Collaborator

@mpbrown mpbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM testing it out locally! Great work on this!

DanielSass
DanielSass previously approved these changes Oct 16, 2024
Copy link
Collaborator

@DanielSass DanielSass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good. Left one comment on a piece I think could be more clear.

@emyl3 emyl3 dismissed stale reviews from DanielSass, mpbrown, and bobbywells52 via 4703aa6 October 21, 2024 18:56
Copy link

sonarcloud bot commented Oct 21, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send symptoms from single entry AOE form to ReportStream
4 participants