src/main/java/ch/bfh/ti/i4mi/mag/mhd/pharm5/Pharm5ResourceProvider.java
/**
     * Handles the PHARM5 Transactions
     *
     * @return {@link Parameters} containing found identifiers
     */
Handles the PHARM5 Transactions
@return  Parameters containing found identifiers
Handles the PHARM5 Transactions @return Parameters containing found identifiers
@SuppressWarnings("unused")
    @Operation(name = Pharm5Constants.PHARM5_OPERATION_NAME, type = DocumentReference.class, idempotent = true, returnParameters = {@OperationParam(name = "return", type = Bundle.class, max = 100)})
    public IBundleProvider findMedicationList(
            @IdParam(optional = true) IdType resourceId,
            @OperationParam(name = Pharm5Constants.PHARM5_PATIENT_IDENTIFIER) TokenParam patientIdentifier,
            @OperationParam(name = Pharm5Constants.PHARM5_STATUS) StringParam status,
            @OperationParam(name = Pharm5Constants.PHARM5_FORMAT) TokenParam format,
            RequestDetails requestDetails,
            HttpServletRequest httpServletRequest,
            HttpServletResponse httpServletResponse) {
        var sourceIdentifier = new Identifier();
        if (resourceId == null) {
            sourceIdentifier.setSystem(patientIdentifier.getSystem())
                    .setValue(patientIdentifier.getValue());
        } else {
            sourceIdentifier.setValue(resourceId.getIdPart());
        }
        var statusType = status == null ? null : new StringType(status.getValue());
        Coding formatCoding = null;
        if (format!=null) {
            formatCoding = new Coding();
            formatCoding.setSystem(format.getSystem()).setCode(format.getValue());
        }
        var inParams = new Parameters();
        inParams.addParameter().setName(Pharm5Constants.PHARM5_PATIENT_IDENTIFIER).setValue(sourceIdentifier);
        inParams.addParameter().setName(Pharm5Constants.PHARM5_STATUS).setValue(statusType);
        if (formatCoding!=null) {
          inParams.addParameter().setName(Pharm5Constants.PHARM5_FORMAT).setValue(formatCoding);
        }
        return requestBundleProvider(inParams, null, ResourceType.DocumentReference.name(),
                httpServletRequest, httpServletResponse, requestDetails);
    }
@ SuppressWarnings ( "unused" ) @ Operation ( name = Pharm5Constants . PHARM5_OPERATION_NAME , type = DocumentReference . class , idempotent = true , returnParameters = { @ OperationParam ( name = "return" , type = Bundle . class , max = 100 ) } ) public IBundleProvider findMedicationList ( @ IdParam ( optional = true ) IdType resourceId , @ OperationParam ( name = Pharm5Constants . PHARM5_PATIENT_IDENTIFIER ) TokenParam patientIdentifier , @ OperationParam ( name = Pharm5Constants . PHARM5_STATUS ) StringParam status , @ OperationParam ( name = Pharm5Constants . PHARM5_FORMAT ) TokenParam format , RequestDetails requestDetails , HttpServletRequest httpServletRequest , HttpServletResponse httpServletResponse ) { var sourceIdentifier = new Identifier ( ) ; if ( resourceId == null ) { sourceIdentifier . setSystem ( patientIdentifier . getSystem ( ) ) . setValue ( patientIdentifier . getValue ( ) ) ; } else { sourceIdentifier . setValue ( resourceId . getIdPart ( ) ) ; } var statusType = status == null ? null : new StringType ( status . getValue ( ) ) ; Coding formatCoding = null ; if ( format != null ) { formatCoding = new Coding ( ) ; formatCoding . setSystem ( format . getSystem ( ) ) . setCode ( format . getValue ( ) ) ; } var inParams = new Parameters ( ) ; inParams . addParameter ( ) . setName ( Pharm5Constants . PHARM5_PATIENT_IDENTIFIER ) . setValue ( sourceIdentifier ) ; inParams . addParameter ( ) . setName ( Pharm5Constants . PHARM5_STATUS ) . setValue ( statusType ) ; if ( formatCoding != null ) { inParams . addParameter ( ) . setName ( Pharm5Constants . PHARM5_FORMAT ) . setValue ( formatCoding ) ; } return requestBundleProvider ( inParams , null , ResourceType . DocumentReference . name ( ) , httpServletRequest , httpServletResponse , requestDetails ) ; }
Handles the PHARM5 Transactions
 @return {@link Parameters} containing found identifiers
Handles the PHARM5 Transactions @return { @link Parameters } containing found identifiers
// FIXME format should be TokenAndListParam