ppazos / testehr

Load tester for the openEHR API
Apache License 2.0
1 stars 0 forks source link

Issue with the JSON Generator not considering constraints in OPT Review #1

Closed ppazos closed 4 years ago

ppazos commented 4 years ago

POST /ehrbase/rest/openehr/v1/ehr/79e5ddb6-9d92-452c-ba9a-5f32015a58d9/composition HTTP/1.1 Content-Type: application/json User-Agent: Java/1.8.0_252 Host: 192.168.1.110:8080 Accept: text/html, image/gif, image/jpeg, ; q=.2, /*; q=.2 Connection: keep-alive Content-Length: 4458

{
    "_type": "COMPOSITION",
    "name": {
        "_type": "DV_TEXT",
        "value": "Review"
    },
    "archetype_details": {
        "archetype_id": {
            "value": "openEHR-EHR-COMPOSITION.review.v1"
        },
        "template_id": {
            "value": "Review"
        },
        "rm_version": "1.0.2"
    },
    "archetype_node_id": "openEHR-EHR-COMPOSITION.review.v1",
    "language": {
        "terminology_id": {
            "value": "ISO_639-1"
        },
        "code_string": "es"
    },
    "territory": {
        "terminology_id": {
            "value": "ISO_3166-1"
        },
        "code_string": "UY"
    },
    "category": {
        "value": "evento",
        "defining_code": {
            "terminology_id": {
                "value": "openehr"
            },
            "code_string": "433"
        }
    },
    "composer": {
        "_type": "PARTY_IDENTIFIED",
        "external_ref": {
            "id": {
                "_type": "HIER_OBJECT_ID",
                "value": "d2e09032-e76b-4a2a-810b-232ae17eed85"
            },
            "namespace": "DEMOGRAPHIC",
            "type": "PERSON"
        },
        "name": "Dr. Yamamoto"
    },
    "context": {
        "start_time": {
            "value": "20200601T200515,175-0300"
        },
        "setting": {
            "value": "atenci\u00f3n de emergencia",
            "defining_code": {
                "terminology_id": {
                    "value": "openehr"
                },
                "code_string": 227
            }
        }
    },
    "content": [{
        "_type": "OBSERVATION",
        "name": {
            "_type": "DV_TEXT",
            "value": "Glasgow coma scale"
        },
        "archetype_node_id": "openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1",
        "language": {
            "terminology_id": {
                "value": "ISO_639-1"
            },
            "code_string": "es"
        },
        "encoding": {
            "terminology_id": {
                "value": "Unicode"
            },
            "code_string": "UTF-8"
        },
        "subject": {
            "_type": "PARTY_SELF"
        },
        "protocol": {
            "_type": "ITEM_TREE",
            "name": {
                "_type": "DV_TEXT",
                "value": "Tree"
            },
            "archetype_node_id": "at0038",
            "items": []
        },
        "data": {
            "_type": "HISTORY",
            "name": {
                "_type": "DV_TEXT",
                "value": "Event Series"
            },
            "archetype_node_id": "at0001",
            "origin": {
                "_type": "DV_DATE_TIME",
                "value": "20200601T200515,196-0300"
            },
            "events": [{
                "_type": "POINT_EVENT",
                "name": {
                    "_type": "DV_TEXT",
                    "value": "Point in time"
                },
                "archetype_node_id": "at0002",
                "time": {
                    "_type": "DV_DATE_TIME",
                    "value": "20200601T200515,201-0300"
                },
                "data": {
                    "_type": "ITEM_TREE",
                    "name": {
                        "_type": "DV_TEXT",
                        "value": "Tree"
                    },
                    "archetype_node_id": "at0003",
                    "items": [{
                        "_type": "ELEMENT",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "Best eye response (E)"
                        },
                        "archetype_node_id": "at0009",
                        "value": {
                            "_type": "DV_ORDINAL",
                            "value": 1,
                            "symbol": {
                                "value": "DBZWVGUHBYYFTOR",
                                "defining_code": {
                                    "terminology_id": {
                                        "value": "local"
                                    },
                                    "code_string": "at0010"
                                }
                            }
                        },
                        "null_flavour": {
                            "_type": "DV_CODED_TEXT",
                            "value": "not applicable",
                            "defining_code": {
                                "terminology_id": {
                                    "value": "openehr"
                                },
                                "code_string": "273"
                            }
                        }
                    }, {
                        "_type": "ELEMENT",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "Best verbal response (V)"
                        },
                        "archetype_node_id": "at0007",
                        "value": {
                            "_type": "DV_ORDINAL",
                            "value": 1,
                            "symbol": {
                                "value": "IHLLJVQICHWUMVQ",
                                "defining_code": {
                                    "terminology_id": {
                                        "value": "local"
                                    },
                                    "code_string": "at0010"
                                }
                            }
                        },
                        "null_flavour": {
                            "_type": "DV_CODED_TEXT",
                            "value": "not applicable",
                            "defining_code": {
                                "terminology_id": {
                                    "value": "openehr"
                                },
                                "code_string": "273"
                            }
                        }
                    }, {
                        "_type": "ELEMENT",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "Best motor response (M)"
                        },
                        "archetype_node_id": "at0008",
                        "value": {
                            "_type": "DV_ORDINAL",
                            "value": 1,
                            "symbol": {
                                "value": "VERPKZTUSYLLERT",
                                "defining_code": {
                                    "terminology_id": {
                                        "value": "local"
                                    },
                                    "code_string": "at0010"
                                }
                            }
                        },
                        "null_flavour": {
                            "_type": "DV_CODED_TEXT",
                            "value": "not applicable",
                            "defining_code": {
                                "terminology_id": {
                                    "value": "openehr"
                                },
                                "code_string": "273"
                            }
                        }
                    }, {
                        "_type": "ELEMENT",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "Total score"
                        },
                        "archetype_node_id": "at0026",
                        "value": {
                            "_type": "DV_COUNT",
                            "magnitude": 1
                        }
                    }, {
                        "_type": "ELEMENT",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "EVM profile"
                        },
                        "archetype_node_id": "at0030",
                        "value": {
                            "_type": "DV_TEXT",
                            "value": "snjCG..zTzIycjRrvzjJtifBbRbzKgZrJnwULDzsBUkzhVonYr mocAmjLeaNyiyPRchjbtbPRJCkZbeScOwFEylLhNzvmsitUpAoor.MTWTXBwIQBSYalZJIokfqyOCpxnfrzkHG,BjNqzbBeuwOejJjXxjtPSdBUOXwy uuVjHRbnytPGnlNwBDvLwVvnzTsOZngzuxuIbflDAgnDqiMeZhidKjFtvpNQZaxqDXF HjfALqxFgzfkfaFlKjND"
                        }
                    }, {
                        "_type": "ELEMENT",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "Comment"
                        },
                        "archetype_node_id": "at0037",
                        "value": {
                            "_type": "DV_TEXT",
                            "value": "d.lZZbdqpQddrCfilSwDGNWAvK.OmwVCNsKiUdWuDB.FpTmCKR,cjtLxRiBbVMiqoIKrLHhOJjgnShT,yHvSBqmnAiJkRPylJiJdHCuGNVoJFWTArIOXTlxGIDFxZNVwXv,QIBwIO.htI.tJEzZTSoxWKOfiU.ubLlGGZyNtsT vQtjMovvi.lfhnzjOzFnb ikQOUtHf.wgvKuZnzuylXTAjbGOOTtzDDzLTKhZvFOCbEIhamVatevnzsNsONX"
                        }
                    }]
                },
                "state": {
                    "_type": "ITEM_TREE",
                    "name": {
                        "_type": "DV_TEXT",
                        "value": "Tree"
                    },
                    "archetype_node_id": "at0040",
                    "items": [{
                        "_type": "ELEMENT",
                        "name": {
                            "_type": "DV_TEXT",
                            "value": "Confounding factors"
                        },
                        "archetype_node_id": "at0041",
                        "value": {
                            "_type": "DV_TEXT",
                            "value": "O,WtscMvymdfXNixtkgHNWhQKKakTTfwHrVVDDQkkSTpRzRhkJZqMwAFzgKqRwkeZlSzOQijHyijuxqFJ.YAiyQiiASWsFayeHKlyE,eMgtsWxaXLColOgOayHqKQTALv Y nTQLxAlNiWOMaFvysZd,IXGMMyZoeBLdk.MZlWoqfWZffyJsYWibDAhpnqRg.UZ,XrGKkSItKboLHrsjcvYuIwwuDIgMdBCnajvthFQLyPeRwrTEkpVOoQHwcvl"
                        }
                    }]
                }
            }]
        }
    }]
}

HTTP/1.1 400 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-Frame-Options: DENY Content-Type: application/json Transfer-Encoding: chunked Date: Mon, 01 Jun 2020 23:05:15 GMT Connection: close

{
    "error": "org.ehrbase.validation.constraints.wrappers.ValidationException: :-Validation error at /content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0009]:Validation error at /content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0009], CODED_TEXT_01:CodedText value is not valid:DvCodedText{code_string=273, terminology_id=openehr, value=not applicable}.\n\n-Validation error at /content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0026]:value is not within interval, expected:3 <= 1 <= 15.\n\n-Validation error at /content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0008]:Validation error at /content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0008], DV_ORDINAL_01:DvOrdinal does not match any valid value, ordinal value:1, code:'DvCodedText{code_string=at0010, terminology_id=local, value=VERPKZTUSYLLERT}'.\n\n-Validation error at /content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0007]:Validation error at /content[openEHR-EHR-OBSERVATION.glasgow_coma_scale.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0007], DV_ORDINAL_01:DvOrdinal does not match any valid value, ordinal value:1, code:'DvCodedText{code_string=at0010, terminology_id=local, value=IHLLJVQICHWUMVQ}'.\n\n",
    "status": "Bad Request"
}
ppazos commented 4 years ago

Fixed the issues with the counts and ordinals now the error is in the coded