Content class resources
Content class resources let you create, retrieve information about, modify, and delete content classes. These resources are not available for tenants that do not have search configuration enabled.
The table below provides information about content class resources.
Trademarks and Legal Disclaimer
© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.
Example: Creating a content class
Here’s a sample PUT request that creates a content class named DICOM and associates it with the Medical-Records namespace, which is search enabled. The content class is defined in an XML file named dicom.xml. The request is made using a tenant-level user account that includes the administrator role.
Request body in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<contentClass>
<name>DICOM</name>
<contentProperties>
<contentProperty>
<name>Doctor_Name</name>
<expression>/dicom_image/doctor/name</expression>
<type>STRING</type>
<multivalued>false</multivalued>
<format></format>
</contentProperty>
<contentProperty>
<name>Doctor_Specialty</name>
<expression>/dicom_image/doctor/specialties/specialty</expression>
<type>STRING</type>
<multivalued>true</multivalued>
<format></format>
</contentProperty>
<contentProperty>
<name>Followup_Needed</name>
<expression>/dicom_image/followup_needed</expression>
<type>BOOLEAN</type>
<multivalued>false</multivalued>
<format></format>
</contentProperty>
<contentProperty>
<name>Image_Date</name>
<expression>/dicom_image/image/date</expression>
<type>DATE</type>
<multivalued>false</multivalued>
<format>MM/dd/yyyy</format>
</contentProperty>
<contentProperty>
<name>Image_Type</name>
<expression>/dicom_image/image/@type</expression>
<type>STRING</type>
<multivalued>false</multivalued>
<format></format>
</contentProperty>
<contentProperty>
<name>Patient_ID</name>
<expression>/dicom_image/patient/id</expression>
<type>INTEGER</type>
<multivalued>false</multivalued>
<format></format>
</contentProperty>
<contentProperty>
<name>Patient_Name</name>
<expression>/dicom_image/patient/name</expression>
<type>STRING</type>
<multivalued>false</multivalued>
<format></format>
</contentProperty>
</contentProperties>
<namespaces>
<name>Medical-Records</name>
</namespaces>
</contentClass>
Request with cURL command line
curl -k -iT dicom.xml -H "Content-Type: application/xml"
-H "Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"
"https://anytown-general-hospital.hcp.../mapi/tenants/
anytown-general-hospital/contentClasses"
Request in Python using PycURL
import pycurl
import os
filehandle = open("dicom.xml", 'rb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Content-Type: application/xml",
"Authorization: HCP \
bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"])
curl.setopt(pycurl.URL,
"https://anytown-general-hospital.hcp...com:9090/mapi/" +
"tenants/anytown-general-hospital/contentClasses")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.UPLOAD, 1)
curl.setopt(pycurl.INFILESIZE, os.path.getsize("dicom.xml"))
curl.setopt(pycurl.READFUNCTION, filehandle.read)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()
Request headers
PUT /mapi/tenants/anytown-general-hospital/contentClasses HTTP/1.1
Host: anytown-general-hospital.hcp.example.com:9090
Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6
Content-Type: application/xml
Content-Length: 2702
Response headers
HTTP/1.1 200 OK
X-HCP-SoftwareVersion: 8.2.0.2
Content-Length: 0
Trademarks and Legal Disclaimer
© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.
Example: Retrieving a list of content classes
Here’s a sample GET request that retrieves a list of the content classes defined for the Anytown-General-Hospital tenant. The request writes the list of content classes to a file named AGH-cc.xml. The request is made using a tenant-level user account that includes the administrator role.
Request with cURL command line
curl -k -i -H "Accept: application/xml"
-H "Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"
"https://anytown-general-hospital.hcp.../mapi/tenants/
anytown-general-hospital/contentClasses?prettyprint" > AGH-cc.xml
Request in Python using PycURL
import pycurl
filehandle = open("AGH-cc.xml", 'wb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Accept: application/xml",
"Authorization: HCP \
bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"])
curl.setopt(pycurl.URL,
"https://anytown-general-hospital.hcp...com:9090/mapi/" +
"tenants/anytown-general-hospital/contentClasses")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.WRITEFUNCTION, filehandle.write)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()
Request headers
GET /mapi/tenants/anytown-general-hospital/contentClasses?prettyprint HTTP/1.1
Host: anytown-general-hospital.hcp.example.com:9090
Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6
Accept: application/xml
Response headers
HTTP/1.1 200 OK
Content-Type: application/xml
X-HCP-SoftwareVersion: 8.2.0.2
Content-Length: 143
Response body in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contentClasses>
<name>Appointment</name>
<name>DICOM</name>
</contentClasses>
Trademarks and Legal Disclaimer
© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.