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

CARDS-1336: Serialize survey responses to EPIC-friendly json format #1198

Draft
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

veronikaslc
Copy link
Contributor

@veronikaslc veronikaslc commented Oct 21, 2022

POC for the CARDS-1336

To test with

  • start with ./start_cards.sh -P prems -f mvn:io.uhndata.cards/cards-epic-integration/0.9-SNAPSHOT/slingosgifeature
  • in the Questionnaire editor add ExternalLink to the questionnaire and some questions (label has to be epic)
  • fill in the Questionnaire form and the create the corresponsing Visit form for it
  • check the Questionnaire form link with URL suffix .toEpic.deep.json.
    For example: http://localhost:8080/Forms/84c7c113-4d7e-4b88-b890-4b20240abacf.toEpic.deep.json

In the generated JSON you should see:

{
  "resourceType": "QuestionnaireResponse",
  "questionnaire": "Questionnaire/<your created ExternalLink>",
  "status": "in-progress", // if Visit form is not submitted
  "subject": {
       "identifier": {
                "system": "<placeholder: CarePlan.activity.reference.type>",
                "value": "<placeholder: CarePlan.activity.reference.identifier.value -> CSN ID for an Appointment>"
            }
  },
  // for answers:
  [
      {
          "linkId": "<placeholder: ID of the Question ID Type>|<your created ExternalLink>",
          "text": "<question text>",
                  "answer": [
                      {
                           "valueString": "<question answer>"
                       }
                    ]
      }, 
  ]
}

@marta-
Copy link
Contributor

marta- commented Oct 21, 2022

This gives us a good start.

A general note:

  • ideally we shouldn't have to specify .deep in the URL, as .toEpic should already produce an Epic-ready response (and the value-less json produced when .deep is omitted is not Epic-ready). Since the mechanism for achieving this is not yet present, we can report and implement it separately (see CARDS-1942) and update toEpic after this is implemented.

Things to do:

  • anything dealing with data coming in and out of Epic, including this processor, should be placed in an epic specific core module (let's name it... epic-io? better names are welcome) so it can be reused across projects
  • implement CARDS-1884 then revisit this code to actually output the Epic identifiers in the serialization.

@marta- marta- added on hold To be reviewed at a later time, awaiting other fixes, decisions, etc. incomplete Some of the target functionality has not yet been implemented labels Oct 21, 2022
@veronikaslc
Copy link
Contributor Author

  • Rebased on top of CARDS-1884 PR
  • Integrated with CARDS-1884 to get the liked IDs to JSON

@marta- marta- changed the base branch from dev to CARDS-1884 October 28, 2022 13:38
@marta-
Copy link
Contributor

marta- commented Oct 28, 2022

[ ] anything dealing with data coming in and out of Epic, including this processor, should be placed in an epic specific core module (let's name it... epic-io? better names are welcome) so it can be reused across projects

epic-integration (via @sdumitriu)

@veronikaslc
Copy link
Contributor Author

Addressed all comments. Note that there are still some placeholders used like here or here

@sashaandjic
Copy link
Contributor

sashaandjic commented Nov 25, 2022

image


QUESTION: I do not see "status": "in-progress", // if Visit form is not submitted as in:
image

@sashaandjic sashaandjic added the question Further information is requested label Nov 25, 2022
@marta- marta- removed the urgent Needs to be completed and merged asap label Nov 25, 2022
@sashaandjic sashaandjic removed question Further information is requested Test me! Ready for testing labels Nov 25, 2022
@sashaandjic sashaandjic added the tested Passed manual testing, needs code review label Nov 25, 2022
Base automatically changed from CARDS-1884 to dev November 25, 2022 23:21
@veronikaslc veronikaslc added Test me! Ready for testing and removed tested Passed manual testing, needs code review labels Nov 29, 2022
@veronikaslc
Copy link
Contributor Author

veronikaslc commented Nov 29, 2022

@sashaandjic Fixed the "status": "in-progress" part.

@veronikaslc
Copy link
Contributor Author

veronikaslc commented Nov 30, 2022

Looking at the specs once again, it looks like the alternative status is completed.

@veronikaslc
Copy link
Contributor Author

The placeholders left:

  • CarePlan.activity.reference.type
  • CarePlan.activity.reference.identifier.value
  • ID of the Question ID Type

@veronikaslc
Copy link
Contributor Author

veronikaslc commented Dec 12, 2022

Added build integration. Rebased on the latest dev.

Integration with CARDS-1884 to actually output the Epic identifiers in the serialization
Updated code to take into consideration the most recent changes of 1884
Moved processor to the separate module epic-integration;
Better answer processing;
Integrating new cards-epic-integration module in the build
Set the completed status if there are no in-progress visit forms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete Some of the target functionality has not yet been implemented on hold To be reviewed at a later time, awaiting other fixes, decisions, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants