Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Referrals record creation; #51

Open
dkryvosheya opened this issue Aug 4, 2017 · 10 comments
Open

Referrals record creation; #51

dkryvosheya opened this issue Aug 4, 2017 · 10 comments
Labels

Comments

@dkryvosheya
Copy link

Hi, Rob!

After creation of the referral record, we're getting 200 - saved - response (http://prntscr.com/g47bzg, http://prntscr.com/g47c7v) - but, the list of records is not updated afterwards (before and after creation of the record it stays as 29 records total: http://prntscr.com/g47ckk);

@robtweed
Copy link
Collaborator

robtweed commented Aug 4, 2017

The UI is doing something very strange that you need to fix first. When you click the Create button, it sends this to the middle tier

GET http://dev.ripple.foundation/api/patients/9999999000/referrals/undefined

@robtweed
Copy link
Collaborator

robtweed commented Aug 4, 2017

On clicking the Save button, after getting the response back for the referrals new Post request, the UI sends the following requests to the middle tier - I understand (2) but don't understand why you send (1) and (3):

  1. GET /api/patients/9999999000
  2. GET /api/patients/9999999000/referrals
  3. GET /api/patients/9999999000/referrals

@robtweed
Copy link
Collaborator

robtweed commented Aug 4, 2017

It would appear that referrals are being posted on Marand by the middle tier.

As a result of what's being sent by the UI, this is what is sent to Marand:

{
"url": "https://ehrscape.code4health.org/rest/v1/composition",
"method": "POST",
"json": true,
"headers": {
"Ehr-Session": "d4b0ead0-a0b5-4b88-91fb-89391b9c79b9"
},
"qs": {
"templateId": "IDCR - Service Request.v0",
"ehrId": "4ee4bad9-2f9e-4e33-b1d6-6572709cabee",
"format": "FLAT"
},
"body": {
"ctx/composer_name": "[email protected]",
"ctx/health_care_facility|id": "999999-345",
"ctx/health_care_facility|name": "Ripple View Care Home",
"ctx/id_namespace": "NHS-UK",
"ctx/id_scheme": "2.16.840.1.113883.2.1.4.3",
"ctx/language": "en",
"ctx/territory": "GB",
"ctx/time": "2017-08-04T14:47:58+01:00",
"request_for_service/referral_details/service_request:0/request:0/service_name": "",
"request_for_service/referral_details/service_request:0/request:0/reason_for_request": "xxx",
"request_for_service/referral_details/service_request:0/request:0/reason_description": "yyy",
"request_for_service/referral_details/service_request:0/request:0/timing": "",
"request_for_service/referral_details/service_request:0/request:0/timing|formalism": "timing",
"request_for_service/referral_details/service_request:0/requestor/person_name/unstructured_name": "Rob",
"request_for_service/referral_details/service_request:0/receiver_identifier": "",
"request_for_service/referral_details/service_request:0/receiver/name_of_organisation": "RMH",
"request_for_service/referral_details/service_request:0/narrative": "",
"request_for_service/referral_details/service:0/receiver_identifier": "",
"request_for_service/referral_details/service:0/ism_transition/current_state|code": "526",
"request_for_service/referral_details/service:0/ism_transition/careflow_step|code": "at0026",
"request_for_service/referral_details/service:0/service_name": ""
}
}

The resulting response being returned by Marand is an error:

response from marand: {
"status": 400,
"code": "COMP-1081",
"userMessage": "Composition validation failed (there are missing or invalid values).",
"developerMessage": "Composition validation failed (there are missing or invalid values).",
"exceptionMessage": "There were errors in validation: Required property /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[0]/narrative missing; Required property /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[1]/description missing; Required property /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[openEHR-EHR-INSTRUCTION.request.v0,'Service request']/narrative missing; Required property /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[openEHR-EHR-INSTRUCTION.request.v0,'Service request']/activities[0]/timing/value missing; Required property /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[openEHR-EHR-INSTRUCTION.request.v0,'Service request']/activities[at0001,'Request']/timing/value missing; Occurences not matched at /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[openEHR-EHR-INSTRUCTION.request.v0,'Service request']/activities[at0001,'Request']/description/items[at0121], expected: [1..1], actual: 0; Required property /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[openEHR-EHR-ACTION.service.v0,'Service']/description missing; Existence not matched at /content[openEHR-EHR-SECTION.referral_details_rcp.v1,'Referral details']/items[openEHR-EHR-ACTION.service.v0,'Service']/description, expected: [1..1], actual: 0",
"moreInfo": "https://confluence.ehrvendor.com/display/ehrrest/COMP-1081",
"requestHref": "https://ehrscape.code4health.org/rest/v1/composition?templateId=IDCR%20-%20Service%20Request.v0&ehrId=4ee4bad9-2f9e-4e33-b1d6-6572709cabee&format=FLAT"
}

We need to figure out from Ian why this is failing

Rob

@robtweed
Copy link
Collaborator

robtweed commented Aug 4, 2017

From Ian: 4 things are missing:

service_request:0/request:0/service_name": "",

is mandatory - can't be skipped

"request_for_service/referral_details/service_request:0/request:0/timing": "",

but you can put anything in there. It is mandatory GTS timing string but is universally ignored!!

"request_for_service/referral_details/service:0/service_name": ""

mandatory - should be the same as for

service_request:0/request:0/service_name": "",

This is the object that tracks the status of the service - in this case it is just saying that the service has been requested

and finally

"request_for_service/referral_details/service_request:0/narrative": "",

This is a mandatory field and is intended to carry a simple narrative summary of the request.

I'll see what I can fix up in the middle tier to satisfy these requirements

Rob

@robtweed
Copy link
Collaborator

robtweed commented Aug 4, 2017

OK referrals should be working now. They're being posted to Ethercis now

@PhilBarrett
Copy link

@robtweed thanks for the update, I've given it a go just now and attach the screenshot of errors I recorded. @dkryvosheya UI level issues?

screenshot 2017-08-07 at 11 53 03

@dkryvosheya
Copy link
Author

@PhilBarrett not experiencing those - we've patched it up on Friday, so it can be a caching issue.

Try to open dev.tools, right-click on the refresh icon on the left of URL bar, and select 'Clear cache and hard reload', and observe if there are errors, thanks!

@robtweed
Copy link
Collaborator

Dmitry - did you update the UI on Showcase?

@dkryvosheya
Copy link
Author

Yes, both showcase and dev are updated;

@tony-shannon
Copy link
Contributor

@PhilBarrett we need to retest this one.. thanks

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

No branches or pull requests

4 participants