PharmaLedger-IMI / ctr-workspace

UC8 Clinical Trials Recruitment
MIT License
2 stars 0 forks source link

ctr-backoffice-frontend/LHC-Forms does not always display a skipLogic question properly #30

Closed joaoluis-pdm closed 3 years ago

joaoluis-pdm commented 3 years ago

LHC-Forms 29.0.3 when used inside ctr-backoffice-frontend 0.4.14 does not always displays a form answer properly. The problem might be related to skipLogic. image For the picture above the JSON stored in DB MatchResult.dsuData is missing the "value" for the "pregnant" question (and for other questions shown blank):

           {
                "value": {
                    "code": "F",
                    "text": "Female",
                    "label": null,
                    "score": null,
                    "system": null
                },
                "header": false,
                "linkId": "gender",
                "answers": [
                    {
                        "code": "M",
                        "text": "Male",
                        "label": null,
                        "score": null,
                        "system": null
                    },
                    {
                        "code": "F",
                        "text": "Female",
                        "label": null,
                        "score": null,
                        "system": null
                    }
                ],
                "dataType": "CNE",
                "editable": "1",
                "question": "What is your gender?",
                "displayControl": {
                    "answerLayout": {
                        "type": "RADIO_CHECKBOX"
                    }
                },
                "answerCardinality": {
                    "max": "1",
                    "min": "1"
                },
                "localQuestionCode": "gender",
                "questionCardinality": {
                    "max": "1",
                    "min": "1"
                }
            },
            {
                "header": false,
                "linkId": "pregnant",
                "answers": [
                    {
                        "code": "yes",
                        "text": "Yes",
                        "label": null,
                        "score": null,
                        "system": null
                    },
                    {
                        "code": "no",
                        "text": "No",
                        "label": null,
                        "score": null,
                        "system": null
                    },
                    {
                        "code": "notSure",
                        "text": "Not sure",
                        "label": null,
                        "score": null,
                        "system": null
                    }
                ],
                "dataType": "CNE",
                "editable": "1",
                "question": "If female, are you pregnant or nursing, or may become pregnant?",
                "skipLogic": {
                    "logic": "ALL",
                    "action": "show",
                    "conditions": [
                        {
                            "source": "gender",
                            "trigger": {
                                "value": {
                                    "code": "F"
                                }
                            }
                        }
                    ]
                },
                "ctrExtension": {
                    "cqtIdCollection": [
                        "0dae59c4-fa54-4dbc-ba03-6ec45c997fb7",
                        "98b20e2e-90c8-469b-bcfd-d408903298eb",
                        "cc2f3f8c-1079-4553-b1af-642554f2c12b"
                    ]
                },
                "displayControl": {
                    "answerLayout": {
                        "type": "RADIO_CHECKBOX"
                    }
                },
                "answerCardinality": {
                    "max": "1",
                    "min": "1"
                },
                "localQuestionCode": "pregnant",
                "questionCardinality": {
                    "max": "1",
                    "min": "1"
                }
            },
            {
                "header": false,
                "linkId": "pregnant_criteria7903856428",
                "dataType": "TITLE",
                "editable": "0",
                "question": "Psoriatic Arthritis4 NCT03895203 CRITERIA MATCH ; Expression: YNNS_NNS (item.value.code=\"notSure\")",
                "displayControl": {
                    "css": [
                        {
                            "name": "color",
                            "value": "darkgreen"
                        }
                    ]
                },
                "answerCardinality": {
                    "max": "0",
                    "min": "0"
                },
                "localQuestionCode": "pregnant_criteria7903856428",
                "questionCardinality": {
                    "max": "1",
                    "min": "1"
                }
            },

... but the TITLEs after the questions with the missing value, show that the proper item.value.code existed when the MatchResult was enriched.

joaoluis-pdm commented 3 years ago

Fixed in e47e73c