Skip to content

Commit

Permalink
Merge pull request #103 from molit-institute/fix-enable-when
Browse files Browse the repository at this point in the history
Fix enable when
  • Loading branch information
rossjan committed Mar 18, 2024
2 parents b3ce08d + e5725f5 commit 062576b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 116 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@molit/questionnaire-renderer",
"version": "1.0.24",
"version": "1.0.25",
"private": false,
"description": "Stencil Component for questionnaire-renderer",
"main": "dist/index.cjs.js",
Expand Down
130 changes: 35 additions & 95 deletions src/assets/fhir/resources/vomit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,91 +9,29 @@ const vomitQuestionnaire = {
item: [
{
linkId: "1",
prefix: "1. ",
text: "Bereitet es Ihnen Schwierigkeiten sich körperlich anzustrengen? (z.B. eine schwere Einkaufsstasche oder einen Koffer zu tragen)",
type: "choice",
required: true,
answerValueSet: "https://molit.eu/fhir/ValueSet/QLQC30-VS-answers4"
prefix: "1.",
text: "Have you ever worked with HL7 FHIR?",
type: "boolean",
// extension: [
// {
// url: "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",
// hidden: true
// }
// ],
},
{
linkId: "2",
prefix: "2. ",
text: "Bereitet es Ihnen Schwierigkeiten sich mental anzustrengen? (z.B. eine schwere Einkaufsstasche oder einen Koffer zu tragen)",
linkId: "1.1",
prefix: "1.1",
text: "Have you ever",
type: "choice",
repeats:true,
required: true,
answerValueSet: "https://molit.eu/fhir/ValueSet/QLQC30-VS-answers7"
// extension: [
// {
// url: "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",
// hidden: true
// }
// ],
answerValueSet: "https://molit.eu/fhir/ValueSet/vkh-VS-ecog"
},
{
linkId:"3",
text:"Dies ist eine gruppe",
type:"group",
item:[
{
linkId: "3.1",
prefix: "3.1 ",
text: "Wählen sie was aus",
type: "choice",
repeats:true,
required: true,
answerValueSet: "https://molit.eu/fhir/ValueSet/QLQC30-VS-answers7"
}
]
}
// {
// linkId: "3",
// prefix: "3. ",
// text: "Bereitet es Ihnen Schwierigkeiten sich mental anzustrengen? (z.B. eine schwere Einkaufsstasche oder einen Koffer zu tragen)",
// type: "choice",
// required: true,
// compose : {
// include : [{
// system : "http://loinc.org",
// version : "2.36",
// concept : [{
// code : "14647-2",
// display : "Cholesterol [Moles/Volume]"
// },
// {
// code : "2093-3",
// display : "Cholesterol [Mass/Volume]"
// },
// {
// code : "35200-5",
// display : "Cholesterol [Mass Or Moles/Volume]"
// },
// {
// code : "9342-7",
// display : "Cholesterol [Percentile]"
// }]
// }]
// }
// },

// {
// linkId: "1",
// prefix: "1.",
// text: "Have you ever worked with HL7 FHIR?",
// type: "boolean",
// extension: [
// {
// url: "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",
// hidden: true
// }
// ],
// },
// {
// linkId: "1.1",
// prefix: "1.1",
// text: "Have you ever",
// type: "boolean",
// extension: [
// {
// url: "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",
// hidden: true
// }
// ],
// },
// {
// linkId: "2",
// prefix: "2.",
Expand All @@ -106,20 +44,22 @@ const vomitQuestionnaire = {
// }
// ],
// },
// {
// linkId: "3",
// prefix: "3.",
// text: "Fraaaaage 3",
// type: "string",
// enableBehavior: "Any",
// enableWhen: [
// {
// question: "1",
// operator: "=",
// answerBoolean: true
// },
// ],
// },
{
linkId: "3",
prefix: "3.",
text: "Fraaaaage 3",
type: "string",
enableWhen: [
{
question: "1.1",
operator: "=",
answerCoding: {
code: "A2",
display: "2"
}
},
],
},


]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ export class QuestionnaireRenderer {
this.createQuestionnaireResponse();
let questionaireResponseItems = questionnaireResponseController.createItemList(this.questionnaireResponse);
this.transferQuestionnaireResponseAnswers(this.currentQuestionnaireResponse, questionaireResponseItems);
//filtern?
this.filterItemList();
} else {
if (this.enableErrorConsoleLogging) {
console.info('QuestionnaireRenderer | Info: Created new questionnaireResponse because neither questionnaireResponse and Questionnaire url or id matched');
Expand Down
42 changes: 22 additions & 20 deletions src/components/test-ui/test-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import qlq_c30 from '../../assets/fhir/resources/qlq-c30.js';
import q_5d_5l from '../../assets/fhir/resources/5q-5d-5l.js';
import vomit from '../../assets/fhir/resources/vomit.js';
import lion from '../../assets/fhir/resources/lion_questionnaire.js';
import lion_response from '../../assets/fhir/resources/lion_questionnaire_response2.js';
// import lion_response from '../../assets/fhir/resources/lion_questionnaire_response2.js';
// import qlq30_response from '../../assets/fhir/resources/qlq30_response.js';

@Component({
Expand All @@ -27,15 +27,15 @@ export class TestUi {
lastQuestion: boolean = false;
edit: boolean = false;
indexQuestion: Object = null;
baseUrl: string = 'https://equ.molit-service.de/fhir2';
baseUrl: string = 'https://equ.molit-service.de/fhir';
// baseUrl: string = 'https://dev.lion-app.de/fhir';
questionnaireUrl: string = this.baseUrl + '/Questionnaire/56'
questionnaire: any = null;
questionnaires: Array<any> = [enableQuestionnaire, everyTypeQuestionnaire, repeatedQuestionnaire, qlq_c30, q_5d_5l, vomit, lion];
token: string = 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJWUkFjb0VJV2JNTlkwNzJLMGFyaTFpUkxqM1dmVUhuWHpWRmd3bDAyVkdzIn0.eyJleHAiOjE2NTIwODc2MzMsImlhdCI6MTY1MTY1NTYzMywiYXV0aF90aW1lIjoxNjUxNDkyNDUzLCJqdGkiOiJmN2EwZjczMS0zOWI2LTQ0NmItODU2Ni1hMDkyOGY2NmFkNjIiLCJpc3MiOiJodHRwczovL2Rldi5saW9uLWFwcC5kZS9hdXRoL3JlYWxtcy9saW9uLXJlYWxtIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjVjMWRiZWQxLTg5YWEtNGM1MS1iZTkxLWM0YTA5NGIxYWIwYiIsInR5cCI6IkJlYXJlciIsImF6cCI6Imxpb24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0_3i0r1_Z9JOKY547JyCCJWcdYO-aQGYv7zZtKMooKIyNTmHzbWSoB_iUkBQjk4LgzBk9bA'
testResp: object = {
"resourceType": "QuestionnaireResponse",
"id": null,
"id": 22,
"status": "completed",

"subject": null,
Expand All @@ -48,30 +48,32 @@ export class TestUi {
"text": "Have you ever worked with HL7 FHIR?",
"answer": [
{
"valueBoolean": true
"valueBoolean": false
}
],
"item": null,
"type": ""
},
{
"linkId": "1.1",
"text": "Have you ever worked with HL7 FHIR?",
"answer": [],
"item": null,
"type": ""
},
{
"linkId": "2",
"text": "Have you ever worked with HL7 FHIR?",
"answer": [],
"item": null,
"type": ""
"linkId":"1.1",
"text":"Have you ever",
"answer":[
{
"valueCoding": {
"code": "A2",
"display": "2"
}
}
]
},
{
"linkId": "3",
"text": "Have you ever worked with HL7 FHIR?",
"answer": [],
"text": "Fraaaaage 3",
"answer": [
{
"valueString": "huhu"
}
],
"item": null,
"type": ""
}
Expand Down Expand Up @@ -178,8 +180,8 @@ export class TestUi {
enableInformationPage={true}
informationPageText="<u>Test</u> Information <br> PageText"
// questionnaireResponse={this.questionnaireResponse}
questionnaireResponse={lion_response}
// questionnaireResponse={this.testResp}
// questionnaireResponse={lion_response}
questionnaireResponse={this.testResp}
questionnaire={this.questionnaire}
// questionnaireUrl={this.questionnaireUrl}
baseUrl={this.baseUrl}
Expand Down

0 comments on commit 062576b

Please sign in to comment.