Open KevinMayfield opened 5 years ago
Also PatientReadFeature @1.2.3
Closing this ticket as the provider suite only checks for mandatory fields and any optional values are captured under manual testing by Solution Assurance
Provider suite is checking for optionals and then failing if not present. So by previous comment this is a fault?
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
Agreed.
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
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.
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.