Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions api-reference/doc-tool/doc-tool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5534,28 +5534,35 @@ paths:
display: "Social History"
note: []
- resource_type: "medicationrequest"
drug_id: "medanta3806727491"
partner_drug_id: "medanta3806727491"
drug_status: "active"
med_name: "Olmezest 40 Tablet"
snomed_id: "1234567"
dose:
id: "du-5550260779"
value: 1.0
unit: "tablet"
custom: "1.0 tablet"
additional_instructions:
- custom: null
- custom: "After Meal"
type: "timing"
duration:
unit: null
value: null
custom: null
unit: "wk"
value: 2
custom: "2 wk"
period: "1"
period_unit: "d"
frequency: 2
dosage_instruction:
custom: "1-0-0"
when: null
period: null
period_unit: null
frequency: null
note: null
custom: "1-0-1"
when: ["MORN","NIGHT"]
period: "1"
period_unit: "d"
frequency: 2
note: "Take with water"
dispense_quantity:
value: 28.0
unit: "tablet"

'403':
description: Forbidden
Expand Down
85 changes: 85 additions & 0 deletions api-reference/general-tools/jq-validator/introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# JQ Validator

This tool helps you validate JQ expressions against JSON payloads, determining if the expressions are syntactically correct and evaluating their results.

## Try it Live

<div style={{ maxWidth: '800px', margin: '0 auto' }}>
<form id="jq-validator-form" style={{ marginBottom: '20px' }}>
<div style={{ marginBottom: '15px' }}>
<label style={{ display: 'block', fontWeight: 'bold', marginBottom: '5px' }}>
JSON Payload:
</label>
<textarea
id="payload"
name="payload"
placeholder="Enter JSON payload"
style={{
width: '100%',
height: '200px',
padding: '10px',
border: '1px solid #ccc',
borderRadius: '4px',
fontFamily: 'monospace',
fontSize: '14px',
resize: 'vertical',
display: 'block',
visibility: 'visible',
backgroundColor: '#535050'
}}
></textarea>
</div>
<div style={{ marginBottom: '15px' }}>
<label style={{ display: 'block', fontWeight: 'bold', marginBottom: '5px' }}>
JQ Expression:
</label>
<input
id="jq-expression-input"
defaultValue=".key"
placeholder="Enter JQ expression, e.g., .name or .age"
style={{
width: '100%',
padding: '10px',
border: '1px solid #ccc',
borderRadius: '4px',
fontFamily: 'monospace',
fontSize: '14px'
}}
/>
</div>
<button
type="button"
id="submit"
style={{
backgroundColor: '#3b82f6',
color: 'white',
padding: '12px 24px',
border: 'none',
borderRadius: '6px',
fontSize: '16px',
fontWeight: 'bold',
cursor: 'pointer',
transition: 'background-color 0.2s',
boxSizing: 'border-box',
display: 'inline-block',
lineHeight: '1.5',
margin: '0',
textAlign: 'center',
textDecoration: 'none',
verticalAlign: 'middle',
WebkitAppearance: 'none',
MozAppearance: 'none',
appearance: 'none'
}}
>
Validate JQ Expression
</button>
</form>
<div id="jq-validation-output"></div>
</div>

<script src="../../../content/validator.js">
defer
id="validator-script"
data-loaded="false"
</script>
45 changes: 45 additions & 0 deletions api-reference/general-tools/jq-validator/jq-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
openapi: 3.0.0
info:
title: JQ Validator API
description: API for validating and evaluating JQ expressions against JSON payloads
version: 1.0.0
paths:
/validate:
post:
summary: Validate and evaluate a JQ expression
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- payload
- expression
properties:
payload:
type: object
description: The JSON payload to evaluate against
expression:
type: string
description: The JQ expression to validate and execute
responses:
'200':
description: Successful validation result
content:
application/json:
schema:
type: object
properties:
valid:
type: boolean
description: Whether the JQ expression is syntactically valid
result:
type: object
description: The result of evaluating the expression
success:
type: boolean
description: Whether the evaluation was successful
error:
type: string
description: Error message if validation or evaluation failed
Loading