nhsconnect / gpconnect-provider-testing

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

GP Patient - generalPractitioner.reference #284

Open KevinMayfield opened 5 years ago

KevinMayfield commented 5 years ago

According to the spec https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1 generalPractioner is optional. However if it is present, reference is optional.

PatientSearchFeature @1.2.3 has entry 'And the Patient GeneralPractitioner Practitioner should be valid and resolvable' with corresponding implementation in GPConnect.Provider.AcceptanceTests.PatientSteps.cs

The line if (patient.GeneralPractitioner.Count.Equals(1)) should also check for existence of the optional reference.

Sample microtest patient has been tested with very latest NHS FHIR validation tools and validated cleanly.

KevinMayfield commented 5 years ago

Also PatientReadFeature @1.2.3

Sado1234 commented 5 years ago

Closing this ticket as the provider suite only checks for mandatory fields and any optional values are captured under manual testing by Solution Assurance

KevinMayfield commented 5 years ago

Provider suite is checking for optionals and then failing if not present. So by previous comment this is a fault?

jonnyry commented 5 years ago

It's optional in the FHIR profile, however as a provider if you hold the data item you should be populating it: https://nhsconnect.github.io/gpconnect/development_fhir_resource_guidance.html#population-of-optional-elements

KevinMayfield commented 5 years ago

Agreed.

Sado1234 commented 5 years ago

Further investigation of this function, around generalPractitioner, highlighted that this is not a valid test for the automation test suite as the cardinality is 0..1. This check will therefore be removed in the scheduled 1.3.0 release.

Note that this test affects 3 other tests in the pack PatientRead.feature: Read patient returned should conform to the GPconnect specification Check read patient on a patient with no Consent returns a valid response PatientSearch.feature: Patient search response conforms with the GPConnect specification

PeterGresty commented 4 years ago

I have fixed the code to check the reference only if it is present, in line with the fhir profile where GeneralPractitioner and reference are both optional. I am working through a number of issues for microtest in a separate branch that I will merge into release/1.2.3 once all fixes have been completed and tested.