# Query from a complicated JSON

**URL:** <https://discuss.elastic.co/t/query-from-a-complicated-json/73680>\
**Category:** Elasticsearch\
**Created:** [February 2, 2017, 1:03pm UTC](https://discuss.elastic.co/t/query-from-a-complicated-json/73680 "2017-02-02T13:03:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manandappa](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@manandappa](https://discuss.elastic.co/u/manandappa)\
**Post date:** [February 2, 2017, 1:03pm UTC](https://discuss.elastic.co/t/query-from-a-complicated-json/73680/1 "2017-02-02T13:03:23Z")

</div>

I have a JSON files that has the following: How do I index and query?  
{  
"HL7PATIENT\_RESULT": {  
"PATIENT": {  
"PatientIdentification": {  
"SetIDPID": {  
"HL7SequenceID": 1  
},  
"PatientName": {  
"HL7FamilyName": {  
"HL7Surname": "0Lab1292"  
},  
"HL7GivenName": "0Test1292",  
"HL7SecondAndFurtherGivenNamesOrInitialsThereof": "NOPATMATCH"  
},  
"DateTimeOfBirth": {  
"year": 1935,  
"month": 49,  
"day": 20,  
"hours": 25,  
"gmtOffset": ""  
},  
"AdministrativeSex": "M",  
"Race": {  
"HL7Identifier": "U"  
},  
"PatientAddress": {  
"HL7StreetAddress": {  
"HL7StreetOrMailingAddress": "529 Main"  
},  
"HL7City": "Roch",  
"HL7StateOrProvince": "CA",  
"HL7ZipOrPostalCode": 30345,  
"HL7CountyParishCode": "Fulton"  
},  
"PhoneNumberHome": {  
"HL7CountryCode": "",  
"HL7AreaCityCode": {  
"HL7Numeric":333  
},  
"HL7LocalNumber": {  
"HL7Numeric": 2223333  
},  
"HL7Extension": ""  
},  
"EthnicGroup": {  
"HL7Identifier": "UNK"  
}

```
		}
	}
}

```

}

---

<div class="post-metadata">

**Author:** ![Matthew\_Isett](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_isett/32/57770_2.png) [@Matthew\_Isett](https://discuss.elastic.co/u/Matthew_Isett)\
**Post date:** [March 1, 2017, 1:26pm UTC](https://discuss.elastic.co/t/query-from-a-complicated-json/73680/2 "2017-03-01T13:26:33Z")

</div>

Marion -  
The query depends on your mapping.  
Can you share the mapping file for this object?

Also how did you convert HL7 into JSON - what was your approach?  
-- Matt

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 29, 2017, 1:26pm UTC](https://discuss.elastic.co/t/query-from-a-complicated-json/73680/3 "2017-03-29T13:26:48Z")

</div>

Closed on March 29, 2017, 1:26pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
