You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have not added the UsSsn extension (UsPatient profile referencing UsSsn extension) in the Patient resource
I have added the PkCnic extension (PkPatient profile referencing PkCnic extension) in the patient resource.
I am validating the resource against the UsPatient profile and it should give cardinality error because I have made 1..1 cardinality everywhere (in the extension for the value[x] and for the extension itself, in the custom patient profile for the extension and for the value[x])
But it is giving "Overall Success" in the OperationOutcome object
HOW TO REPRODUCE:
Download the custom profiles from the specified path
give the path to specification.zip
give the path to custom profiles directory
create any type of .net core app and run the code
Here is my code.
Patient patient = new Patient();
patient.Id = "1";
patient.Gender = AdministrativeGender.Male;
patient.Active = true;
HumanName hn = new HumanName();
hn.Family = "Jhon";
hn.Given = new List<string> { "Doe" };
patient.Name.Add(hn);
patient.AddExtension("http://example.org/fhir/StructureDefinition/PkCnic", new FhirString("123456789"));
ZipSource zipSource = new ZipSource("<path to specification.zip>\\specification.zip");
DirectorySource directorySource = new DirectorySource("<path to custom profiles directory>");
MultiResolver mr = new MultiResolver(zipSource, directorySource);
Validator validator = new Validator(new ValidationSettings
{
ResourceResolver = mr
});
OperationOutcome operationOutcome = validator.Validate(
patient,
"http://example.org/fhir/StructureDefinition/UsPatient");
The text was updated successfully, but these errors were encountered:
We have been working on slice validation lately. This update will be released in version 1.4.0, but that has not been released yet.
When I try this use case with the improved slice validation, I get the following error:
[FATAL] Internal logic failure: The value discriminator should have either a 'fixed[x]' or 'binding' element set on 'http://example.org/fhir/StructureDefinition/UsSsn#Extension.url'. (at Patient)
And that is correct because there is no fixed or binding used in the profiles. When you add fixedUri in UsSsn.StructureDefinition.xml then it will work:
<elementid="Extension.url">
<pathvalue="Extension.url" />
<representationvalue="xmlAttr" />
<shortvalue="identifies the meaning of the extension" />
<definitionvalue="Source of the definition for the extension code - a logical name or a URL." />
<commentvalue="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
<minvalue="1" />
<maxvalue="1" />
<base>
<pathvalue="Extension.url" />
<minvalue="1" />
<maxvalue="1" />
</base>
<fixedUrivalue="http://example.org/fhir/StructureDefinition/PkCnic"/>
<type>
... etc..
Note: [...].extension.url elements in the StructureDefinition.snapshot component MUST specify a fixedUri value, otherwise the profile is invalid. We are about to publish a new Forge 23.0 release that contains logic to automatically generate required fixedUri values if missing. Once the new release is available, you can repair these errors by opening a profile in Forge and saving it back to disk.
FHIR chat link: FHIR Chat Link
Custom Profiles Link: Custom Profiles Link
ISSUE AND EXPECTED BEHAVIOR:
I have not added the UsSsn extension (UsPatient profile referencing UsSsn extension) in the Patient resource
I have added the PkCnic extension (PkPatient profile referencing PkCnic extension) in the patient resource.
I am validating the resource against the UsPatient profile and it should give cardinality error because I have made 1..1 cardinality everywhere (in the extension for the value[x] and for the extension itself, in the custom patient profile for the extension and for the value[x])
But it is giving "Overall Success" in the OperationOutcome object
HOW TO REPRODUCE:
Here is my code.
The text was updated successfully, but these errors were encountered: