Class FindQueryUtils
java.lang.Object
org.projecthusky.communication.xdsmhdconversion.utils.FindQueryUtils
Utilities for MHD "Find" transactions (ITI-66 and ITI-67).
- Author:
- Quentin Ligier
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ca.uhn.fhir.rest.server.exceptions.InvalidRequestExceptioninvalidRequestException(org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String message, Object... args) static StringparseAuthor(@Nullable ca.uhn.fhir.rest.param.StringParam stringParam, String author) Converts a string token from a FHIR search parameter to a string of XDS author.static voidparseAuthor(@Nullable ca.uhn.fhir.rest.param.StringParam stringParam, List<@NonNull String> authors) Converts a string token from a FHIR search parameter to a list of XDS authors.static voidparseCodeList(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam tokenOrListParam, List<@NonNull org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> codeList, String paramName) Converts a list of token from a FHIR search parameter to a list of XDSCodes and maps the FHIR system URIs to XDS system OIDs if the mapping exists.static voidparseStatusParam(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam statusTokens, List<org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus> statusList) Parses the query parameter 'status' as a set ofAvailabilityStatusand adds it to the corresponding field of the find document query.static voidparseStringList(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam tokens, List<@NonNull String> stringList, String paramName) Converts a list of token from a FHIR search parameter to a list of strings.static List<@NonNull org.openehealth.ipf.commons.ihe.xds.core.metadata.Code>toXdsCodeList(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam tokens) Converts a list of token from a FHIR search parameter to a list of XDSCodes and maps the FHIR system URIs to XDS system OIDs if the mapping exists.static XdsTimeRangetoXdsTimeRange(@Nullable ca.uhn.fhir.rest.param.DateRangeParam dateRange) Constructs an XDS time range from a FHIR date range.
- 
Constructor Details- 
FindQueryUtilspublic FindQueryUtils()
 
- 
- 
Method Details- 
parseCodeListpublic static void parseCodeList(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam tokenOrListParam, List<@NonNull org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> codeList, String paramName) throws ca.uhn.fhir.rest.server.exceptions.InvalidRequestException Converts a list of token from a FHIR search parameter to a list of XDSCodes and maps the FHIR system URIs to XDS system OIDs if the mapping exists. The tokens shall not have a modifier.- Parameters:
- tokenOrListParam- The FHIR tokens search parameter.
- codeList- The XDS code list.
- paramName- The name of the FHIR parameter.
- Throws:
- ca.uhn.fhir.rest.server.exceptions.InvalidRequestException
 
- 
parseStringListpublic static void parseStringList(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam tokens, List<@NonNull String> stringList, String paramName) throws ca.uhn.fhir.rest.server.exceptions.InvalidRequestException Converts a list of token from a FHIR search parameter to a list of strings. The tokens shall not have a system or a modifier.- Parameters:
- tokens- The FHIR tokens search parameter.
- stringList- The string list.
- paramName- The name of the FHIR parameter.
- Throws:
- ca.uhn.fhir.rest.server.exceptions.InvalidRequestException
 
- 
parseStatusParampublic static void parseStatusParam(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam statusTokens, List<org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus> statusList) throws ca.uhn.fhir.rest.server.exceptions.InvalidRequestException Parses the query parameter 'status' as a set ofAvailabilityStatusand adds it to the corresponding field of the find document query. It is required and limited to 'current' and 'superseded' values.- Parameters:
- statusTokens- The FHIR search parameters 'status'.
- statusList- The list of XDS availability status to be filled.
- Throws:
- ca.uhn.fhir.rest.server.exceptions.InvalidRequestException
 
- 
parseAuthorpublic static void parseAuthor(@Nullable ca.uhn.fhir.rest.param.StringParam stringParam, List<@NonNull String> authors) Converts a string token from a FHIR search parameter to a list of XDS authors.IPF does not accept modifiers for these fields. - Parameters:
- stringParam- The FHIR search parameters.
- authors- The list of author.
 
- 
parseAuthorpublic static String parseAuthor(@Nullable ca.uhn.fhir.rest.param.StringParam stringParam, String author) Converts a string token from a FHIR search parameter to a string of XDS author.IPF does not accept modifiers for these fields. - Parameters:
- stringParam- The FHIR search parameters.
- author- The author.
 
- 
toXdsTimeRangepublic static XdsTimeRange toXdsTimeRange(@Nullable ca.uhn.fhir.rest.param.DateRangeParam dateRange) Constructs an XDS time range from a FHIR date range.XDS time range is compared with an inclusive lower bound and an exclusive upper bound. The instants returned by the DateRangeParamare both inclusive, so the upper bound is shifted by one second.- Parameters:
- dateRange- The FHIR date range search parameter.
- Returns:
- the equivalent XDS time range.
 
- 
toXdsCodeListpublic static List<@NonNull org.openehealth.ipf.commons.ihe.xds.core.metadata.Code> toXdsCodeList(@Nullable ca.uhn.fhir.rest.param.TokenOrListParam tokens) throws ca.uhn.fhir.rest.server.exceptions.InvalidRequestException Converts a list of token from a FHIR search parameter to a list of XDSCodes and maps the FHIR system URIs to XDS system OIDs if the mapping exists.- Parameters:
- tokens- The list of FHIR tokens.
- Returns:
- a list of equivalent XDS codes.
- Throws:
- ca.uhn.fhir.rest.server.exceptions.InvalidRequestException- if a token is invalid.
 
- 
invalidRequestException
 
-