Beispiel #1
0
  @Override
  public FhirQueryAuditDataset enrichAuditDatasetFromRequest(
      FhirQueryAuditDataset auditDataset, Object request, Map<String, Object> parameters) {
    FhirQueryAuditDataset dataset =
        super.enrichAuditDatasetFromRequest(auditDataset, request, parameters);

    Parameters params = (Parameters) request;
    if (params != null) {
      Type sourceIdentifier =
          params
              .getParameter()
              .stream()
              .filter(ppc -> Constants.SOURCE_IDENTIFIER_NAME.equals(ppc.getName()))
              .map(Parameters.ParametersParameterComponent::getValue)
              .findFirst()
              .orElseThrow(() -> new RuntimeException("No sourceIdentifier in PIX query"));

      if (sourceIdentifier instanceof Identifier) {
        Identifier identifier = (Identifier) sourceIdentifier;
        dataset
            .getPatientIds()
            .add(String.format("%s|%s", identifier.getSystem(), identifier.getValue()));
      } else if (sourceIdentifier instanceof StringType) {
        StringType identifier = (StringType) sourceIdentifier;
        dataset.getPatientIds().add(identifier.getValue());
      } else {
        dataset.getPatientIds().add(sourceIdentifier.toString());
      }
    }
    return dataset;
  }
Beispiel #2
0
 @Override
 public void doAudit(FhirQueryAuditDataset auditDataset) {
   AuditorManager.getFhirAuditor()
       .auditIti83(
           isServerSide(),
           auditDataset.getEventOutcomeCode(),
           auditDataset.getServiceEndpointUrl(),
           auditDataset.getClientIpAddress(),
           auditDataset.getQueryString(),
           auditDataset.getPatientIds());
 }