Skip to content

Commit

Permalink
🐛 Handle the base profile url with version suffix in the validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogukan Cavdaroglu committed Dec 5, 2024
1 parent efc25e8 commit 86fab31
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ class FHIRResourceValidator(fhirConfigurationManager: IFhirConfigurationManager)

//profiles listed in Resource.meta.profile
val profilesClaimedToConform = FHIRUtil.extractProfilesFromBson(resource)
.map(profile => {
// Check if the profile matches the current FHIR version-specific profile URL
if(profile.contentEquals(s"$FHIR_ROOT_URL_FOR_DEFINITIONS/StructureDefinition/$rtype|${fhirConfigurationManager.fhirConfig.fhirVersion}")) {
// If it matches, return the profile URL without the version suffix
s"$FHIR_ROOT_URL_FOR_DEFINITIONS/StructureDefinition/$rtype"
} else
profile
})

//Supported profiles for resource type in CapabilityStatement.rest.resource.supportedProfiles
val supportedProfiles = fhirConfigurationManager.fhirConfig.resourceConfigurations.get(rtype).map(_.supportedProfiles).getOrElse(Set.empty[String])
//Unknow profiles among them
Expand Down

0 comments on commit 86fab31

Please sign in to comment.