Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

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.

Data type

Method

Use

Access

Notes

.../tenants/tenant-name/contentClasses

contentClass

PUT

Create a content class for a tenant

For an HCP tenant, tenant-level user account with the administrator role

For the default tenant, system-level user account with the administrator role

 

List

GET

Retrieve a list of the content classes for a tenant

For an HCP tenant, tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

The listed content classes are identified by content class name.

In XML, the element that identifies each content class is name. The root element for the list of content classes is contentClasses.

In JSON, the name in the name/value pair that lists the content classes is name.

.../tenants/tenant-name/contentClasses/content-class-name

contentClass

GET

Retrieve information about a content class

For an HCP tenant, tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

 

N/A

HEAD

Check for the existence of a content class

For an HCP tenant, tenant-level user account with the monitor or administrator role

For the default tenant, system-level user account with the monitor or administrator role

 

contentClass

POST

Modify a content class

For an HCP tenant, tenant-level user account with the administrator role

For the default tenant, system-level user account with the administrator role

 

N/A

DELETE

Delete a content class

For an HCP tenant, tenant-level user account with the administrator role

For the default tenant, system-level user account with the administrator role

The content class cannot contain any content properties.

© 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

© 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>

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.

 

  • Was this article helpful?