From df04dffff43624eb8ebb4ceae98ae41b98d039c3 Mon Sep 17 00:00:00 2001 From: JohanGHole Date: Mon, 16 Dec 2024 18:23:36 +0100 Subject: [PATCH] fix: Prevent HTML encoding of apostrophes in generated FSH descriptions --- public/assets/ProgramLogicalModel.fsh.handlebars | 4 ++-- public/assets/ProgramStageLogicalModel.fsh.handlebars | 2 +- src/tests/resources/expectedTbProgram.fsh | 2 +- src/tests/resources/mockTbProgram.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/assets/ProgramLogicalModel.fsh.handlebars b/public/assets/ProgramLogicalModel.fsh.handlebars index cfa0ceb..383fc1c 100644 --- a/public/assets/ProgramLogicalModel.fsh.handlebars +++ b/public/assets/ProgramLogicalModel.fsh.handlebars @@ -7,11 +7,11 @@ Description: "{{description}}" * enrollmentDate 1..1 date "{{enrollmentDateLabel}}" * incidentDate 0..1 date "{{incidentDateLabel}}" {{#programTrackedEntityAttributes}} -* {{toFhirDataElementName trackedEntityAttribute}} {{toFhirCardinality mandatory}}..1 {{toFhirDataType trackedEntityAttribute.valueType trackedEntityAttribute.optionSet}} "{{toFhirElementDescription trackedEntityAttribute}}" +* {{toFhirDataElementName trackedEntityAttribute}} {{toFhirCardinality mandatory}}..1 {{toFhirDataType trackedEntityAttribute.valueType trackedEntityAttribute.optionSet}} "{{{toFhirElementDescription trackedEntityAttribute}}}" {{#if trackedEntityAttribute.optionSet}} * {{toFhirDataElementName trackedEntityAttribute}} from {{toPascalCase trackedEntityAttribute.optionSet.name}}VS (required) {{/if}} {{/programTrackedEntityAttributes}} {{#programStages}} -* {{toCamelCase name}} 0..{{isRepeatable repeatable}} {{toPascalCase name}} "{{toFhirElementDescription this}}" +* {{toCamelCase name}} 0..{{isRepeatable repeatable}} {{toPascalCase name}} "{{{toFhirElementDescription this}}}" {{/programStages}} \ No newline at end of file diff --git a/public/assets/ProgramStageLogicalModel.fsh.handlebars b/public/assets/ProgramStageLogicalModel.fsh.handlebars index 1950bde..8223234 100644 --- a/public/assets/ProgramStageLogicalModel.fsh.handlebars +++ b/public/assets/ProgramStageLogicalModel.fsh.handlebars @@ -6,7 +6,7 @@ Description: "{{description}}" {{/if}} * executionDate 0..1 date "{{displayExecutionDateLabel}}" {{#programStageDataElements}} -* {{toFhirDataElementName dataElement}} {{toFhirCardinality compulsory}}..1 {{toFhirDataType dataElement.valueType dataElement.optionSet}} "{{toFhirElementDescription dataElement}}" +* {{toFhirDataElementName dataElement}} {{toFhirCardinality compulsory}}..1 {{toFhirDataType dataElement.valueType dataElement.optionSet}} "{{{toFhirElementDescription dataElement}}}" {{#if dataElement.optionSet}} * {{toFhirDataElementName dataElement}} from {{toPascalCase dataElement.optionSet.name}}VS (required) {{/if}} diff --git a/src/tests/resources/expectedTbProgram.fsh b/src/tests/resources/expectedTbProgram.fsh index 51b9bbc..cdd79dc 100644 --- a/src/tests/resources/expectedTbProgram.fsh +++ b/src/tests/resources/expectedTbProgram.fsh @@ -3,7 +3,7 @@ Title: "TB program" Parent: Base * enrollmentDate 1..1 date "Start of treatment date" * incidentDate 0..1 date "Start of treatment date" -* firstName 1..1 string "First name" +* firstName 1..1 string "This is the person's first name" * lastName 1..1 string "Last name" * gender 1..1 code "Gender" * gender from GenderVS (required) diff --git a/src/tests/resources/mockTbProgram.json b/src/tests/resources/mockTbProgram.json index 2de1f6b..431449f 100644 --- a/src/tests/resources/mockTbProgram.json +++ b/src/tests/resources/mockTbProgram.json @@ -199,7 +199,7 @@ "trackedEntityAttribute": { "name": "First name", "shortName": "First name", - "description": "First name", + "description": "This is the person's first name", "valueType": "TEXT", "displayName": "First name" }