Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format validation error. #65

Merged
merged 2 commits into from
Sep 17, 2020
Merged

Conversation

ms-teli
Copy link
Contributor

@ms-teli ms-teli commented Sep 17, 2020

Format validation errors:

Device

Example 1:

{
    "templateType": "CollectionContent",
    "template": [
        {
            "templateType": "JsonPathContent",
            "template": {
                "typeName": "heartrate",
                "typeMatchExpression": "$..[?(@heartRate && @endDate)]",
                "values": [
                    {
                        "required": "true",
                        "valueName": "hr"
                    }
                ]
            }
        },
        {
            "templateType": "IotJsonPathContent",
            "template": {
                "typeName": "bootTime",
                "values": [
                    {
                        "required": "false",
                        "valueExpression": "$.Body.patientActiveTime",
                        "valueName": "activeTime"
                    }
                ]
            }
        }
    ]
}

Result:

Validation errors:
Failed to deserialize the JsonPathContentTemplate content: 
  Required property 'ValueExpression' not found in JSON. Path 'values[0]'.
  Required property 'DeviceIdExpression' not found in JSON. 
  Required property 'TimestampExpression' not found in JSON. 
Failed to deserialize the IotJsonPathContentTemplate content: 
  Required property 'TypeMatchExpression' not found in JSON. 

Example 2:

{}

Result

Validation errors:
Expected TemplateType value CollectionContentTemplate, actual Not Found.

Example 3

{
  "templateType": "CollectionContents",
  "template": [
    {
      "templateType": "JsonPathContent",
      "template": {
        "typeName": "heartrate",
        "typeMatchExpression": "$..[?(@heartRate && @endDate)]",
        "deviceIdExpression": "$.deviceId",
        "timestampExpression": "$.endDate",
        "values": [
          {
            "required": "true",
            "valueExpression": "$.heartRate",
            "valueName": "hr"
          }
        ]
      }
    }
  ]
}

result:

Validation errors:
Expected TemplateType value CollectionContentTemplate, actual CollectionContents.

FHIR

Example 1

{
  "templateType": "CollectionFhir",
  "template": []
}

Result

Validation errors:
Expected TemplateType value CollectionFhirTemplate, actual CollectionFhirs.

Example 2

{
  "templateType": "CollectionFhir",
  "template": [
    {
      "templateType": "CodeValueFhir",
      "template": {
        "codes": [
          {
            "code": "85354-9",
            "display": "Blood pressure panel with all children optional",
            "system": "http://loinc.org"
          }
        ],
        "periodInterval": 60
      }
    }
  ]
}

Result

Validation errors:
Failed to deserialize the CodeValueFhirTemplate content: 
  Required property 'TypeName' not found in JSON. 

@ms-teli ms-teli marked this pull request as ready for review September 17, 2020 17:58
@ms-teli ms-teli merged commit 486a2fd into master Sep 17, 2020
@dustinburson dustinburson deleted the personal/teli/format-validation-message branch November 8, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants