nhsconnect / gpconnect-provider-testing

GP Connect automated test suite for API providers
Apache License 2.0
11 stars 5 forks source link

PatientRegisterFeature - invalid FHIR Patient Resource #308

Closed KevinMayfield closed 4 years ago

KevinMayfield commented 5 years ago

This is not supplying test Patients with a valid FHIR birthDate e.g. 13/02/1999 (note the odd dob will work fine but only a few)

This stops the FHIR Parser from conversion to FHIR Parameter resource.

To work around we have changed DefaultRegisterPatientBuilder to use a hard coded date string.

KevinMayfield commented 5 years ago

Causes 43 test failures.

Work around is the change line 30 of DefaultRegisterPatientBuilder.cs to

BirthDate = "1970-10-16",

PeterGresty commented 5 years ago

Hi Kevin, The code you have highlighted, simply uses the DOB for the patient, that is hard coded in the RegisterPatient.csv file that drives those tests. These tests have worked for other providers and against demonstrator with no issues, so on the surface this looks to be a possible bug in your date handling code..

KevinMayfield commented 5 years ago

We are using standard C# FHIR parsing libraries to handle the resources and have also tested using FHIR validation.

PeterGresty commented 5 years ago

Can you supply screenshots/logs for the failed tests, showing what specific errors you are getting please.

KevinMayfield commented 5 years ago

This is an example resource received from the test pack:

{ "resourceType": "Patient", "meta": { "profile": [ "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" ] }, "identifier": [ { "extension": [ { "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-NHSNumberVerificationStatus-1", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-NHSNumberVerificationStatus-1", "code": "01", "display": "Number present and verified" } ] } } ], "system": "https://fhir.nhs.uk/Id/nhs-number", "value": "9651259612" } ], "name": [ { "use": "official", "given": [ "Eric" ] } ], "gender": "male", "birthDate": "02/01/1977" }

If your use https://data.developer.nhs.uk/ccri/term/validate to validate (which uses java HL7/HAPI FHIR libs ) This fails to parse with the following error:

Failed to parse request body as JSON resource. Error was: Invalid attribute value "02/01/1977": Invalid date/time format: "02/01/1977"

KevinMayfield commented 5 years ago

note: We have also raised an issue with a GPC Patient profile as the above resource would also fail because no ID is supplied (id is mandatory according to the profile)

PeterGresty commented 5 years ago

When I look at the request for a register patient test on my machine, the date is in the correct format, So either something is affecting the date format coming out from the provider suite on your machine (maybe regional settings) or something has translated/altered the date after leaving the provider suite would be my guess at this point.. Can you confirm a) where the above resource came from (your logs or provider suite logs) b) can you switch on all the logging switches in app.config and send me, the logs files produced in c:\temp please. These switches: set to true>>>>" ReportingToFile:Enabled, ReportingToFile:OutputFailureMessage, ReportingToFile:SortFailFirst, traceOutputJSONResponse, traceOutputJWT, traceOutputJSONRequestBody and traceOutputConsoleLog

KevinMayfield commented 5 years ago

Sent to functional.assurance@nhs.net

PeterGresty commented 4 years ago

Have you tried to run these test on another machine? the test pack is working for multiple providers and also a number of nhs people,. so this appears to be a problem with your setup. Please confirm you have tried another PC/Setup before we investigate any further.

KevinMayfield commented 4 years ago

Appears to be caused by different date format in RegisterPatient.csv Checking to see how the date could have changed

PeterGresty commented 4 years ago

As I have previously explained... I understand that the format in the file is not the same as what is transmitted and required in fhir but this code is working for other providers and us, so before any change for this is attempted , I would like you to try this on another machine to rule out a problem on your machine. Once you have confirmed that back, I will look at another possible solution.

KevinMayfield commented 4 years ago

Our RegisterPatient.csv had somehow had it's date fields changed (into UK format, suspect by loading into excel). It is now working.