diff --git a/.cursor/rules/ascii-source.mdc b/.cursor/rules/ascii-source.mdc new file mode 100644 index 0000000..ad837c1 --- /dev/null +++ b/.cursor/rules/ascii-source.mdc @@ -0,0 +1,22 @@ +--- +description: Tracked source and docs must be ASCII only +alwaysApply: true +--- + +# ASCII source + +Every file you **add or edit** must be **ASCII only** (bytes 0x00-0x7F). Scan touched paths before finishing. + +Replace: + +| Non-ASCII | ASCII | +| ------------------ | ----------- | +| em/en dash, minus | `-` | +| ellipsis | `...` | +| curly quotes | `'` / `"` | +| arrows | `->` / `<-` | +| non-breaking space | space | + +Do not introduce Unicode symbols, emoji, or locale punctuation in code, comments, XML, or docs. + +WSDL/XSD copied from the licensed toolkit may contain non-ASCII. Do not add more. Prefer ASCII in files you author. diff --git a/.cursor/rules/documentation-standards.mdc b/.cursor/rules/documentation-standards.mdc new file mode 100644 index 0000000..c756526 --- /dev/null +++ b/.cursor/rules/documentation-standards.mdc @@ -0,0 +1,54 @@ +--- +description: Documentation and build scripts - implementor-first, Maven Central default, no secrets +alwaysApply: true +--- + +# Documentation and build scripts + +Applies when writing or editing **README**, **CONTRIBUTING**, integrator guides, **SECURITY**, release notes, **build.*** / **build.xml** header comments, **settings.xml.example**, **local.properties.example**, and similar tracked material. + +## Priority: implementors + +- Primary audience: developers **consuming** published Maven artifacts. +- Contributor/maintainer workflow lives in **CONTRIBUTING.md**, **MAINTAINERS.md**, or labelled subsections - not mixed into the integrator main flow. +- Do not duplicate agent workflow in README or CONTRIBUTING (**AGENTS.md** -> `.cursor/rules/`). + +## Default narrative: Maven Central + +- Write as if **released** coordinates are on Maven Central (no SNAPSHOT, sibling-repo checkout, or `-P...` profiles in the main integrator path). +- Use **version numbers** in integrator docs - not Git branch names. +- SNAPSHOT installs, optional Maven profiles, licensed WSDL for source builds, and sibling `mvn install` belong under **Local development** / **Local builds** only. + +## Structure + +| Where | What | +| ----- | ---- | +| README / integrator docs | Dependency, runtime config, capabilities | +| Local development | Unpublished builds, SNAPSHOT, profiles, source-tree prerequisites | +| By OS (when needed) | Separate **Windows**, **macOS**, **Linux** blocks (wrappers, cleanup, path notes) | + +## Paths + +- **Relative paths only** (e.g. `wsdls/xml`, `./certs//`, `pom.xml` beside repo root). +- **Never** hardcode machine paths (`C:\...`, `/Users/...`, `~/`, worktree folders) in tracked docs. +- Override only when strictly required to remove ambiguity - say why. + +## Current state only + +- No migration, legacy, or branch-history commentary in user-facing docs. +- Describe **what is true now**; omit "removed", "used to", and repo archaeology in integrator material. +- **CHANGELOG** entries: current release capabilities; avoid branch names and migration essays in new notes. + +## Secrets - MUST NOT + +- **Never** put real or plausible **passwords**, **tokens**, **API keys**, **private keys**, or **keystore passphrases** in tracked files (code, comments, examples, docs). +- Use placeholders (``), empty values in `.example` files, or "from your registration pack". +- See **SECURITY.md**. + +## ASCII source + +All tracked files you add or change must be **ASCII only**. See **`ascii-source.mdc`**. + +## Override + +These rules may be overridden **only when necessary** to clear ambiguity (e.g. maintainer branch mapping in **MAINTAINERS.md** or `.cursor/rules/`, clearly labelled maintainer-only). diff --git a/.cursor/rules/mhr-b2b-project.mdc b/.cursor/rules/mhr-b2b-project.mdc index 5475cdb..3c12937 100644 --- a/.cursor/rules/mhr-b2b-project.mdc +++ b/.cursor/rules/mhr-b2b-project.mdc @@ -1,30 +1,31 @@ --- -description: MHR B2B client scope, WSDL policy, Java 8 javax build +description: MHR B2B client scope, WSDL policy, Java 17 Jakarta build alwaysApply: true --- -# mhr-b2b-client-java (Java 8 / javax) +# mhr-b2b-client-java (Java 17 / Jakarta) -My Health Record **PCEHR B2B** client — **not** Healthcare Identifiers (HI). Do **not** reference **`myhr-b2b-client-java`** or other aggregator/unified client projects in docs or comments. End-user docs: **`README.md`**, **`ADHA-THIRD-PARTY-SCOPE.md`**, **`MAINTAINERS.md`**. Agent WSDL/facade matrix: **`.cursor/WSDL-CLIENT-PURPOSES.md`** (gitignored). +My Health Record **PCEHR B2B** client - **not** Healthcare Identifiers (HI). Do **not** reference **`myhr-b2b-client-java`** or other aggregator/unified client projects in docs or comments. End-user docs: **`README.md`**, **`ADHA-THIRD-PARTY-SCOPE.md`**, **`MAINTAINERS.md`**. Agent WSDL/facade matrix: **`.cursor/WSDL-CLIENT-PURPOSES.md`** (gitignored). ## Release line (integrator docs use Maven Central versions only) -| Version | Java | APIs | Facades | -| ---- | ---- | ---- | ---- | -| **1.6.3** | 8 | javax | **15** (12 WSDLs; three WSDLs each used by two facades) | +| Version | Java | APIs | Facades | +| ---------- | ---- | ------- | ------------------------------------------------------- | +| **17.0.0** | 17 | Jakarta | **15** (12 WSDLs; three WSDLs each used by two facades) | -**This checkout:** **`1.6.3-SNAPSHOT`** — **`au.gov.nehta:pcehr-compiled-wsdl`** at **`${project.version}`**; Java **8** / **`javax.*`**. +**This checkout:** **`17.0.0-SNAPSHOT`** - sibling **`au.gov.nehta`** libs at **`${project.version}`**; Java **17** / **Jakarta** XML APIs. ## WSDL/XSD (committed in Git) -PCEHR B2B WSDL/XSD under `wsdls/src/main/resources/` are **not** separate ADHA-licensed artefacts (unlike HI in hi-b2b-client-java). **Keep them in Git** for reference and for **`pcehr-compiled-wsdl-java`**. Compile against **`au.gov.nehta:pcehr-compiled-wsdl`** at **`pcehr.wsdl.version`** = **`${project.version}`** — install matching **`pcehr-compiled-wsdl-java`** first. **Six** view facades under `clients.view`; seven **`getView`** types — **`ADHA-THIRD-PARTY-SCOPE.md`**. Optional Ant **`wsimport`** under **`wsdls/`** (not part of default **`mvn verify`**). +PCEHR B2B WSDL/XSD under `wsdls/src/main/resources/` are **not** separate ADHA-licensed artefacts (unlike HI in hi-b2b-client-java). **Keep them in Git** for reference and for **`mhr-wsdl-java`**. Compile against **`au.gov.nehta:mhr-wsdl`** at **`${project.version}`** - install matching **`mhr-wsdl-java`** first. **Six** view facades under `clients.view`; seven **`getView`** types - **`ADHA-THIRD-PARTY-SCOPE.md`**. Optional Ant **`wsimport`** under **`wsdls/`** (not part of default **`mvn verify`**). ## Build -- JDK **8**: install sibling **`pcehr-compiled-wsdl-java`** at the same version, then `mvn -B "-Dgpg.skip=true" clean verify` -- JAX-WS: **`com.sun.xml.ws:jaxws-rt` 2.3.7** — not legacy Metro **`webservices-*`** -- Enforcer bans Metro **`webservices-*`** (application code uses **`javax.*`** only) +- JDK **17**: install sibling **`au.gov.nehta`** libs at the same version, then `mvn -B "-Dgpg.skip=true" clean verify` +- JAX-WS: **`com.sun.xml.ws:jaxws-rt` 4.0.5** - not legacy Metro **`webservices-*`** +- Enforcer bans Metro **`webservices-*`** and legacy **`javax.xml.ws`**, **`javax.xml.bind`**, and **`javax.xml.soap`** - Default Surefire: offline tests; **`-Pintegration`** for mutual-TLS suite -- Strict Javadoc: **`doclint=all`**, **`failOnWarnings=true`** +- Javadoc: **`doclint=none`**, **`failOnWarnings=false`** +- Thin JAR default; optional **`-Pfat-jar`** See `README.md`, `MAINTAINERS.md`, `wsdls/readme.txt`. diff --git a/.cursor/rules/worktrees.mdc b/.cursor/rules/worktrees.mdc new file mode 100644 index 0000000..0e10a40 --- /dev/null +++ b/.cursor/rules/worktrees.mdc @@ -0,0 +1,37 @@ +--- +description: Git worktrees are local only; integrator docs use Maven versions, not paths or branches +alwaysApply: true +--- + +# Worktrees (local convenience only) + +**`git worktree`** lets a maintainer check out multiple branches of the **same repository** at once. Worktree **directory paths are machine-specific** and must **not** appear in tracked documentation. + +## What tracked docs describe + +Follow **`documentation-standards.mdc`** (implementor-first, Maven Central default). + +| Doc | Audience | Use | +| --- | -------- | --- | +| **README**, integrator guides | Implementors | **Maven version** (`11.0.0`), Central coordinates, runtime config | +| **CONTRIBUTING** | Contributors | Build from source, **Local builds**, OS-specific steps | +| **MAINTAINERS**, **`.cursor/rules/`** | Maintainers | POM/wsimport internals; **branch mapping** only when labelled maintainer-only | + +Integrator docs: **version numbers**, not Git branch names. Local/SNAPSHOT/profile flows: **CONTRIBUTING** only. + +## Do not put in tracked docs + +- Hardcoded worktree or machine paths (`wt/`, `C:\...`, `/Users/...`, `~/`, `this worktree`, `primary clone`) +- References to **`wt/README.md`** or other local-only layout files +- "Open folder X to switch branches" - IDE/local workflow, not repo documentation + +## Allowed (maintainer-only, when labelled) + +- **Git branch mapping** table (version -> branch) in **MAINTAINERS.md** or agent rules +- Generic worktree example only: `git worktree add ` (placeholder **``**, never a committed example) +- Optional **untracked** local notes outside the repo + +## When editing docs + +1. Identify the **Maven version / release line** the text applies to, not the worktree folder Cursor has open. +2. Remove or rewrite any committed worktree path tables or branch names in integrator-facing files. diff --git a/.gitattributes b/.gitattributes index 63df57e..63d8480 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,19 @@ * text=auto eol=lf -*.class binary -*.jar binary -*.jks binary -*.zip binary - +*.md text eol=lf +*.txt text eol=lf +*.xml text eol=lf +*.xsd text eol=lf +*.wsdl text eol=lf +*.jxb text eol=lf +*.java text eol=lf +*.properties text eol=lf +*.sh text eol=lf *.bat text eol=crlf *.cmd text eol=crlf +*.ps1 text eol=crlf + +*.jar binary +*.jks binary +*.p12 binary +*.pfx binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2801bfb..724000c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,10 @@ -# Runs default offline unit tests + Javadoc/sources (verify), then compiles sample sources. name: CI on: push: + branches: [ java-17 ] pull_request: + branches: [ java-17 ] permissions: contents: read @@ -12,21 +13,21 @@ jobs: verify: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 + - uses: actions/checkout@v7 with: - repository: AuDigitalHealth/pcehr-compiled-wsdl-java - ref: java-8-javax-full-wsdl - path: pcehr-compiled-wsdl-java + repository: AuDigitalHealth/mhr-wsdl-java + ref: java-17 + path: mhr-wsdl-java - uses: actions/setup-java@v5 with: distribution: temurin - java-version: "8" + java-version: "17" cache: maven - - name: Install pcehr-compiled-wsdl (1.6.3-SNAPSHOT) - working-directory: pcehr-compiled-wsdl-java - run: mvn -B -Dgpg.skip=true clean install -DskipTests + - name: Install mhr-wsdl (17.0.0-SNAPSHOT) + working-directory: mhr-wsdl-java + run: mvn -B "-Dgpg.skip=true" clean install -DskipTests - name: Maven verify - run: mvn -B -Dgpg.skip=true clean verify + run: mvn -B "-Dgpg.skip=true" clean verify - name: Compile sample sources (sample profile) - run: mvn -B -Psample -Dgpg.skip=true -DskipTests=true clean compile + run: mvn -B -Psample "-Dgpg.skip=true" -DskipTests=true clean compile diff --git a/.gitignore b/.gitignore index 6890eb7..fbe9aa2 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ wsdls/target/ wsdls/dist/ wsdls/build/ wsdls/extern/ + +# Agent-local reference (not for integrators) +.cursor/local-reference.md +.cursor/WSDL-CLIENT-PURPOSES.md diff --git a/ADHA-THIRD-PARTY-SCOPE.md b/ADHA-THIRD-PARTY-SCOPE.md new file mode 100644 index 0000000..6b59408 --- /dev/null +++ b/ADHA-THIRD-PARTY-SCOPE.md @@ -0,0 +1,44 @@ +# Third-party B2B scope + +This library (**`au.gov.nehta:mhr-b2b-client`**, Maven line **17.0.0**, Java **17** / **Jakarta**) implements the **vendor-facing My Health Record B2B** interfaces listed by **mhr-b2b-client-dotnet** (logical names below). Wire SOAP still uses published **`pcehr`** namespaces and operation names; Java packages and type names use **`mhr`**. + +## In scope (full) + +| Logical name (.NET README) | Java facade | SOAP / IHE backing | +| -------------------------- | -------------------------------- | --------------------------------------- | +| doesPCEHRExist | `DoesMHRExistClient` | MHR profile | +| gainPCEHRAccess | `GainMHRAccessClient` | MHR profile | +| uploadDocument | `UploadDocumentClient` | Document repository ProvideAndRegister | +| retrieveDocument | `GetDocumentClient` | Document repository RetrieveDocumentSet | +| uploadDocumentMetadata | `UploadDocumentMetadataClient` | Document registry RegisterDocumentSet-b | +| findDocuments | `GetDocumentListClient` | Document registry RegistryStoredQuery | +| removeDocument | `RemoveDocumentClient` | removeDocument | +| getAuditView | `GetAuditViewClient` | getAuditView | +| getChangeHistoryView | `GetChangeHistoryViewClient` | getChangeHistoryView | +| getView | `GetViewClient` | getView + 7 clinical views | +| getTemplate | `GetTemplateClient` | getTemplate | +| searchTemplate | `SearchTemplateClient` | searchTemplate | +| getIndividualDetailsView | `GetIndividualDetailsViewClient` | getIndividualDetailsView | +| getRepresentativeList | `GetRepresentativeListClient` | getRepresentativeList | +| registerPCEHR | `RegisterMHRClient` | registerPCEHR | + +### getView clinical views (7) + +- healthCheckScheduleView +- medicareOverview +- observationView +- prescriptionAndDispenseView +- healthRecordOverview +- diagnosticImagingReportView +- pathologyReportView + +Generated request types and facade overloads live in **`mhr-wsdl`** / **`GetViewClient`**. Offline tests **`MhrFacadeCoverageTest`** and **`MhrWsdlArtifactSmokeTest`** lock this set (**15** facades, **7** getView clinical views). + +Types and classpath WSDL for the 12 SOAP services are published as **`au.gov.nehta:mhr-wsdl`** at the same Maven version. + +## Out of scope + +- **Advance Care Planning** view (NPP / non-vendor packs; not in the .NET third-party README list). +- **Achievement Diary** view (removed from the vendor B2B pack; see CHANGELOG **1.1.5**). + +Do not treat commented historical snippets in older source as a gap. Those views are intentionally absent. diff --git a/AGENTS.md b/AGENTS.md index 51a3553..5778063 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,8 +4,12 @@ Rules: `.cursor/rules/*.mdc`. Do not duplicate in README or CONTRIBUTING. | Concern | Rule / reference | |---------|------------------| -| MHR scope, WSDL, build, Java 8 / javax | `mhr-b2b-project.mdc` | +| ASCII only in authored files | `ascii-source.mdc` | +| Documentation and build scripts (implementor-first, Central, local, OS, paths, no secrets) | `documentation-standards.mdc` | +| MHR scope, WSDL, build, Java 17 / Jakarta | `mhr-b2b-project.mdc` | +| Worktrees local only; versions in integrator docs | `worktrees.mdc` | +| Multi-branch edits in one repo - use worktree, not checkout/stash | `multi-branch-worktrees.mdc` | | WSDL-to-facade matrix (agent only) | `.cursor/WSDL-CLIENT-PURPOSES.md` | -| Multi-branch edits in one repo — use worktree, not checkout/stash | `multi-branch-worktrees.mdc` | +| Multi-branch edits in one repo - use worktree, not checkout/stash | `multi-branch-worktrees.mdc` | -Contributors (humans): README, CONTRIBUTING.md, MAINTAINERS.md, ADHA-THIRD-PARTY-SCOPE.md, wsdls/readme.txt. +Contributors (humans): README, CONTRIBUTING.md, MAINTAINERS.md, SECURITY.md, CHANGELOG.md, ADHA-THIRD-PARTY-SCOPE.md, wsdls/readme.txt. diff --git a/CHANGELOG.md b/CHANGELOG.md index 741560b..df24feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,47 +1,72 @@ # Change Log/Revision History -= 1.6.3-SNAPSHOT = -================== -- Java 8 / javax public-release line: EE4J jaxws-rt 2.3.7, pcehr-compiled-wsdl at ${project.version}, modernized Maven build and CI. -- Strict Javadoc (doclint=all, failOnWarnings); enforcer bans Metro webservices-*. -- Optional Ant wsimport under wsdls/: EE4J tooling in lib/provided (not Metro webservices-*); sync-lib + ant generate-src; WsdlsCodegenToolingTest guards layout. +# = 17.0.0 = + +- Maven **`au.gov.nehta:mhr-b2b-client`** **17.0.0** (Java **17** / **Jakarta**, **15** facades). The first number of the Maven version is the targeted Java SE version. Pair with **`au.gov.nehta:mhr-wsdl`** at the same coordinate. +- Sibling libs **`common-library`**, **`smi-xsp`**, and **`smi-common-utils`** at **`${project.version}`** (**17.0.0**). +- Java packages and types use **`mhr`** names (`vendorlibrary.mhr`, **`DoesMHRExistClient`**, **`MHRHeader`**, **`RegisterMHRClient`**). SOAP namespaces and element names remain the B2B **`pcehr`** wire contract (**`PCEHRHeader`**, **`registerPCEHR`**). +- Runtime: **`com.sun.xml.ws:jaxws-rt` 4.0.5**. **`maven-enforcer-plugin`** bans Metro **`webservices-*`** and legacy **`javax.xml.ws`**, **`javax.xml.bind`**, and **`javax.xml.soap`** APIs. +- Default package is a thin JAR; optional **`-Pfat-jar`** attaches classifier **`all`**. +- Javadoc: **`doclint=none`**, **`failOnWarnings=false`** (same as other Java **17** sibling lines). +- Offline Metadata unit tests encode CDA fixtures with **`StandardCharsets.UTF_8`** so Windows platform encoding does not break UTF-8 BOM XML after **`smi-common-utils`** **`IOUtils.read`**. +- POM: Sonatype Central Portal (**`central-publishing-maven-plugin`**; server id **`central`**). +- Offline smoke tests: **`JaxwsRuntimeSmokeTest`**, **`MhrWsdlArtifactSmokeTest`** (loads **`MHRProfileService`**), **`MhrFacadeCoverageTest`** (15 facades / 12 services / getView **7** views vs **mhr-b2b-client-dotnet**). +- Documentation: README, CONTRIBUTING, MAINTAINERS, SECURITY, **ADHA-THIRD-PARTY-SCOPE.md**. + +# = 11.0.0 = + +- Maven **`au.gov.nehta:mhr-b2b-client`** **11.0.0** (Java **11** / **Jakarta**, **15** facades). The first number of the Maven version is the targeted Java SE version. Pair with **`au.gov.nehta:mhr-wsdl`** at the same coordinate. +- Sibling libs **`common-library`**, **`smi-xsp`**, and **`smi-common-utils`** at **`${project.version}`** (**11.0.0**). +- Java packages and types use **`mhr`** names (`vendorlibrary.mhr`, **`DoesMHRExistClient`**, **`MHRHeader`**, **`RegisterMHRClient`**). SOAP namespaces and element names remain the B2B **`pcehr`** wire contract (**`PCEHRHeader`**, **`registerPCEHR`**). +- Runtime: **`com.sun.xml.ws:jaxws-rt` 4.0.5**. **`maven-enforcer-plugin`** bans Metro **`webservices-*`** and legacy **`javax.xml.ws`**, **`javax.xml.bind`**, and **`javax.xml.soap`** APIs. +- POM: Sonatype Central Portal (**`central-publishing-maven-plugin`**; server id **`central`**). +- Offline smoke tests: **`JaxwsRuntimeSmokeTest`**, **`MhrWsdlArtifactSmokeTest`** (loads **`MHRProfileService`**), **`MhrFacadeCoverageTest`** (15 facades / 12 services / getView **7** views vs **mhr-b2b-client-dotnet**). +- Documentation: README, CONTRIBUTING, MAINTAINERS, SECURITY, **ADHA-THIRD-PARTY-SCOPE.md**. + +# = 1.6.3 = + +Historical past release (superseded by **11.0.0** on this line). + +- Java 11 / Jakarta public-release line: EE4J jaxws-rt 4.0.5, mhr-wsdl at ${project.version}, modernized Maven build and CI. +- Strict Javadoc (doclint=all, failOnWarnings); enforcer bans Metro webservices-\*. +- Optional Ant wsimport under wsdls/: EE4J tooling in lib/provided (not Metro webservices-\*); sync-lib + ant generate-src; WsdlsCodegenToolingTest guards layout. - Removed stale resources.zip duplicate; dropped optional codegen wrapper scripts. - Documentation: README, CONTRIBUTING, MAINTAINERS, SECURITY; offline Surefire default; -Pintegration for mutual-TLS tests. -= 1.1.7 = -========= +# = 1.1.7 = + - Converted to Maven -= 1.1.6 = -========= +# = 1.1.6 = + - updated WSDL jar to 2.4.4, changes to HRO response object. - updated FormatCodes.java and DocumentTypeCodes.java (version staying the same) -= 1.1.5 = -========= +# = 1.1.5 = + - updated WSDL jar to 2.4.3, changes to view Common Types => streeNameType > streetNameType - removed AvancedCarePlaning and AchievmentDiary view -= 1.1.4 = -========= +# = 1.1.4 = + - Updated "Advanced Care Directive Custodian Record" display name -= 1.1.3 = -========= +# = 1.1.3 = + - Updated PCEHR wsdl jar -= 1.1.2 = -========= +# = 1.1.2 = + - Aligned document type code and class code display name with NeHTA C# client for XDSMetadata - upload document -= 1.1.1 = -========= -- Updated PCEHR wsdl jar to nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.4.1.jar +# = 1.1.1 = + +- Updated PCEHR wsdl jar to nehta-vendorlibrary-java-mhr-wsdl-2.4.1.jar - added new DocumentTypeCodes for Pathology and DI - modified XDS Metadata service start stop time for pathology/di -= 1.1.0 = -========= +# = 1.1.0 = + - updates to the nehta-smi-xsp and nehta-vendorlibrary-common jars - Updated all clients to replace CertificateVerifier with CertificateValidator this is a backwards compatible change in line with the smi-xsp jar @@ -50,103 +75,101 @@ - added GetDiagnosticView - added getHROView -= 1.0.1 = -========= +# = 1.0.1 = + - changed slot name for class code queries to $XDSDocumentEntryClassCode. -= 1.0.0 = -========= +# = 1.0.0 = + - Removed document title from XDS metadata for Document Upload -= 0.7.12 (DRAFT) = -========= +# = 0.7.12 (DRAFT) = + - Changed wsdl reference to updated 2.3.0 libraries with XMLDSIG overrides - Changed NeHTA common jar to 1.0.4 -= 0.7.11 (DRAFT) = -========= +# = 0.7.11 (DRAFT) = + - Changed getDocumentList client, client encodes CodedValues with the carrot (^) delimiter now. - Changed DocumentTypeCodes coding system name to align with C# lang Impl - Changed DocumentQueryParams.java - TemplateId is now a CodedValue - Added DocumentEventClass Query - NB:this release is backward-compatible with Java 6. + NB:this release is backward-compatible with Java 6. + +# = 0.7.10 (DRAFT) = -= 0.7.10 (DRAFT) = -========= - Changed MTOM handling to allow for optional Register Document NB:this release is backward-compatible with Java 6. +# = 0.7.9 (DRAFT) = - -= 0.7.9 (DRAFT) = -========= - Added utility function in UploadDocumentClient to include respository ID, hash and size information - in the XDS metadata (for NPDR only, as the repository is deficient in adding these additional fields when + in the XDS metadata (for NPDR only, as the repository is deficient in adding these additional fields when registering the document on the PCEHR). - changed instances of "Summarisation" to "Summarization" as in "Discharge Summarisation Note" and "Summarization of episode note" NB:this release is backward-compatible with Java 6. -= 0.7.8 (DRAFT) = -========= -- Modifications To RegisterPCEHRClient and Client.javato fix a bug with MTOM. +# = 0.7.8 (DRAFT) = + +- Modifications To RegisterMHRClient and Client.javato fix a bug with MTOM. NB:this release is backward-compatible with Java 6. -= 0.7.7 (DRAFT) = -========= +# = 0.7.7 (DRAFT) = + - generic Object type for getView client request NB:this release is backward-compatible with Java 6. -= 0.7.6 (DRAFT) = -========= +# = 0.7.6 (DRAFT) = + - added default language code - no empty document hashes - NB:this release is backward-compatible with Java 6. -= 0.7.5 (DRAFT) = -========= +# = 0.7.5 (DRAFT) = + - bug fix for NPE on documentHash - NB:this release is backward-compatible with Java 6. -= 0.7.4 (DRAFT) = -========= +# = 0.7.4 (DRAFT) = + - added ObservationView capability to the getView client - modified XDS metadata location for prescription organisation author NB:this release is backward-compatible with Java 6. -= 0.7.3 (DRAFT) = -========= +# = 0.7.3 (DRAFT) = + - updated compiled wsdl jar to vesrsion 2.2.4 which fixes a bug with xml binding to an xsi:anyType on Health Check Schedule VSiew. NB:this release is backward-compatible with Java 6. -= 0.7.2 (DRAFT) = -========= +# = 0.7.2 (DRAFT) = + - Modified PCEHR client for new view types using xsi:anyType NB:this release is backward-compatible with Java 6. -= 0.7.1.6 (DRAFT) = -========= +# = 0.7.1.6 (DRAFT) = + - This is a special rebuild of 0.7.1 for vendors using Java 6 beyond its End Of Life date. - see: http://www.oracle.com/technetwork/java/eol-135779.html + see: http://www.oracle.com/technetwork/java/eol-135779.html + +# = 0.7.1 (DRAFT) = -= 0.7.1 (DRAFT) = -========= - Added class codes for PCEHR Prescription Record and PCEHR Dispense Record. - Updated GetViewClient to use MTOM binding by default. - Updated GetView wsdl class to include a "view" wrapper on the view objects (elements). - Updated GetViewClient to support the following views: - 1. PrescriptionAndDispenseView - 2. MedicareOverview - 3. HealthCheckScheduleView + 1. PrescriptionAndDispenseView + 2. MedicareOverview + 3. HealthCheckScheduleView - Updated XdsMetadata class to use "DateTime Prescription Written" as Service Start Time and Service End Time for PCEHR Prescription Records. - Updated XdsMetadata class to use "DateTime of Dispense Event" as Service Start Time and Service End Time for PCEHR Dispense Records. - Updated eSignature libraries to v1.1 - Updated clinicalPackage libraries to v1.2.2 -= 0.7.0 (DRAFT) = -========= +# = 0.7.0 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: @@ -155,11 +178,12 @@ reference implementation provided with Java 6. Should you require a different ve PCEHR client libraries and properties will need to be updated and re-compiled accordingly. Change History: + - Added new view type GetObservationalView - Removed getConstolidatedView -= 0.6.9 (DRAFT) = -========= +# = 0.6.9 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: @@ -168,12 +192,13 @@ reference implementation provided with Java 6. Should you require a different ve PCEHR client libraries and properties will need to be updated and re-compiled accordingly. Change History: + - Added new format codes for PCEHR Prescription Record and PCEHR Dispense Record. - Added "authorSpecialty" into XDS metadata for both UploadDocumentClient and UploadDocumentMetadataClient. - Updated class code for ePrescription and Dispense Record. -= 0.6.8 (DRAFT) = -========= +# = 0.6.8 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: @@ -182,10 +207,11 @@ reference implementation provided with Java 6. Should you require a different ve PCEHR client libraries and properties will need to be updated and re-compiled accordingly. Change History: -- Updated to reflect changes in PCEHR WSDLs. New sample clients for getRepresentativeList, getIndividualDetailsView, and getView web services. -= 0.6.7 (DRAFT) = -========= +- Updated to reflect changes in PCEHR WSDLs. New sample clients for getRepresentativeList, getIndividualDetailsView, and getView web services. + +# = 0.6.7 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: @@ -194,10 +220,11 @@ reference implementation provided with Java 6. Should you require a different ve PCEHR client libraries and properties will need to be updated and re-compiled accordingly. Change History: + - Updated MetadataUtils.toDocumentMetadata() to allow for PAI-D and LocalSystemIdentifier XCN Author IDs -= 0.6.6 (DRAFT) = -========= +# = 0.6.6 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: @@ -206,22 +233,25 @@ reference implementation provided with Java 6. Should you require a different ve PCEHR client libraries and properties will need to be updated and re-compiled accordingly. Change History: + - Enhancement to allow client properties to be set using 'setProperty' method. For instance: - DoesPCEHRExistClient client = ... // constructor call + DoesMHRExistClient client = ... // constructor call client.setProperty(JAXWSProperties.CONNECT_TIMEOUT, 180000); // Timeout of three minutes. - Abstraction of client code to improve manageability. - Accessor method for 'Client' port. -= 0.6.5 (DRAFT) = -========= +# = 0.6.5 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: + - 'GetDocument' SOAP response from SVT does not comply with DEXS-T 109 of the PCEHR Document Exchange Service Technical Service Specification. This is in the process of being corrected. - 'UploadDocument' SOAP request is being incorrectly rejected by the SVT as having an invalid signature. This is in the process of being corrected. Change History: + - Added new 'MTOMHandler.java' SOAPHandler to address JAX-WS limitations. This applies to 'UploadDocument'. Without this additional functionality, the request is limited to a single SOAP envelope that contains the Base64-encoded document, inline. This is due to SOAPHandlers forcing the content back into the original SOAP envelope. The new handler manually splits out the content into a new MTOM MIME part and injects an XOP reference to that @@ -233,24 +263,28 @@ Change History: - Removed skipping of the 'GetDocument' operation response verification check in 'SecurityHandler.java' (see version 0.6.4 release notes for further detail). -= 0.6.4 (DRAFT) = -========= +# = 0.6.4 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: + - 'GetDocument' SOAP response from SVT does not comply with DEXS-T 109 of the PCEHR Document Exchange Service Technical Service Specification. Change History: + - Added new enum value to 'DocumentStatus' => 'urn:ordreq:names:statusType:Deleted', as documented in the PCEHR Implementation Guide. -= 0.6.3 (DRAFT) = -========= +# = 0.6.3 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Known Limitations: + - 'GetDocument' SOAP response from SVT does not comply with DEXS-T 109 of the PCEHR Document Exchange Service Technical Service Specification. Change History: + - New 'SecurityHandler' code to partially skip validation of the GetDocument SOAP response. This code is as follows: /** Start DEXS-T 109 Ignore **/ @@ -262,65 +296,71 @@ Change History: If this functionality is undesired, remove/comment out the above lines. Signature verification will then fail for that response, with the handling of the exception and response left to the vendor. -= 0.6.2 (DRAFT) = -========= +# = 0.6.2 (DRAFT) = + This is a draft release of sample code for the PCEHR interfaces. Pre-Requisites: + - SVT 5.11 (or greater) environment required for support of: - 1) CDA document root value of type UUID in document uploads. - 2) Signature verification - 3) 'GetRepresentativeList' and 'RegisterPCEHR' clients. + 1. CDA document root value of type UUID in document uploads. + 2. Signature verification + 3. 'GetRepresentativeList' and 'RegisterMHR' clients. Change History: + - Fix for 'UploadDocument' submission set metadata association for document replacement. - Fix metadata value mismatch for 'XDSDocumentEntry.typeCodeDisplayName'. - Updated 'FormatCodes' values to reflect current environment values. 'CodedValue' types can be passed - to the 'UploadDocument*' clients in the event that the 'FormatCodes' are insufficient or incorrect. + to the 'UploadDocument\*' clients in the event that the 'FormatCodes' are insufficient or incorrect. - Fix to 'UploadDocument' time-based metadata population (refer to 'XPathExpressions' for the corresponding XPaths for the following rules): - 1) DocumentMetadata.ServiceStartTime = [XPathExpressions.SERVICE_START_TIME|XPathExpressions.SERVICE_FIXED_TIME|XPathExpressions.CREATION_TIME] - 2) DocumentMetadata.ServiceStopTime = [XPathExpressions.SERVICE_STOP_TIME|XPathExpressions.SERVICE_FIXED_TIME|XPathExpressions.CREATION_TIME] - The value of each time is populated from a single XPath result, from right to left, in order of precision. + 1. DocumentMetadata.ServiceStartTime = [XPathExpressions.SERVICE_START_TIME|XPathExpressions.SERVICE_FIXED_TIME|XPathExpressions.CREATION_TIME] + 2. DocumentMetadata.ServiceStopTime = [XPathExpressions.SERVICE_STOP_TIME|XPathExpressions.SERVICE_FIXED_TIME|XPathExpressions.CREATION_TIME] + The value of each time is populated from a single XPath result, from right to left, in order of precision. + +# = 0.6.1 (DRAFT) = -= 0.6.1 (DRAFT) = -========= This is a draft release of sample code for the PCEHR interfaces. This release works against the current interfaces. Pre-Requisites: + - SVT 5.11 (or greater) environment required for support of: - 1) CDA document root value of type UUID in document uploads. - 2) Signature verification - 3) 'GetRepresentativeList' and 'RegisterPCEHR' clients. + 1. CDA document root value of type UUID in document uploads. + 2. Signature verification + 3. 'GetRepresentativeList' and 'RegisterMHR' clients. Change History: -- Modified 'RegisterPCEHR' sample code to provide an correct example for: - 1) registering a PCEHR with an IHI (child-specific sample code, with parent assertion details) - 2) registering a PCEHR with demographics (individual-specific code) + +- Modified 'RegisterMHR' sample code to provide an correct example for: + 1. registering a PCEHR with an IHI (child-specific sample code, with parent assertion details) + 2. registering a PCEHR with demographics (individual-specific code) - Inclusion of generated code JAR files supporting the deprecation of the 'GetIndividualDetails' operation: - 1) nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.1.0-docs.jar - 2) nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.1.0-sources.jar - 3) nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.1.0.jar + 1. nehta-vendorlibrary-java-mhr-wsdl-2.1.0-docs.jar + 2. nehta-vendorlibrary-java-mhr-wsdl-2.1.0-sources.jar + 3. nehta-vendorlibrary-java-mhr-wsdl-2.1.0.jar + +# = 0.6.0 (DRAFT) = -= 0.6.0 (DRAFT) = -========= This is a draft release of sample code for the PCEHR interfaces. This release works against the current interfaces. Pre-Requisites: + - SVT 5.11 (or greater) environment required for support of: - 1) CDA document root value of type UUID in document uploads. - 2) Signature verification - 3) 'GetRepresentativeList' and 'RegisterPCEHR' clients. + 1. CDA document root value of type UUID in document uploads. + 2. Signature verification + 3. 'GetRepresentativeList' and 'RegisterMHR' clients. Change History: + - Abstraction of some common client behaviour to improve manageability. - Updated 'license.txt' with new license text for vendor library usage. -- Added 'RegisterPCEHR' client and sample code. +- Added 'RegisterMHR' client and sample code. - Added 'GetRepresentativeList' client and sample code. - Added response signature verification to 'SecurityHandler', utilising XSP libraries. For further detail - on the verification process, please see the '/lib/provided/nehta-smi-xsp-1.0.3*.jar' libraries. + on the verification process, please see the '/lib/provided/nehta-smi-xsp-1.0.3\*.jar' libraries. - Added a constructor to clients that accepts an additional 'CertificateVerifier' object parameter. If certificate verification is not desired, the original constructor should be used. This constructor now passes an empty 'CertificateVerifier' implementation parameter. @@ -329,17 +369,19 @@ Change History: - Added 'CertificateVerifierUsageSample' to show how a 'CertificateVerifier' instance would be supplied to a client. -= 0.5 (DRAFT) = -========= +# = 0.5 (DRAFT) = + This is a draft release of sample code the PCEHR interfaces. This release works against the current interfaces. Known Issues: + - CDA document root value must be an OID, for document uploads. Other operations may accept both in situations where the SVT environment contains valid documents with UUIDs. Change History: + - UTC times supported for 'SubmitObjectsRequest' times. These values are extracted from the CDA root document and support the following formats defined in the 'DateParsePatterns' enum. Note that all UTC times will conform to the following format: @@ -352,18 +394,20 @@ Change History: serviceStartTime = '/ClinicalDocument/componentOf/encompassingEncounter/effectiveTime/low/@value' serviceStopTime = '/ClinicalDocument/componentOf/encompassingEncounter/effectiveTime/high/@value' -= 0.4 (DRAFT) = -========= +# = 0.4 (DRAFT) = + This is a draft release of sample code the PCEHR interfaces. This release works against the current interfaces. Known Issues: + - CDA document root value must be an OID, for document uploads. Other operations may accept both in situations where the SVT environment contains valid documents with UUIDs. - UploadDocumentMetadata operations are not supported in this release. Change History: + - Updated template FormatCodes to reflect the current values supported in the SVT environment. - Added a helper class 'DocumentUtils' which provides a method to update the ID @@ -372,16 +416,18 @@ Change History: - Added an additional method for the 'UploadDocumentClient' to allow a document to be replaced. -= 0.3 (DRAFT) = -========= +# = 0.3 (DRAFT) = + This is a draft release of sample code the PCEHR interfaces. This release works against the current interfaces. Known Issues: + - CDA documents root value must be an OID. - UploadDocumentMetadata operations are not supported in this release. Change History: + - Updated Template FormatCodes ID values to match current test IDs. - Included additional enum entries for Template FormatCodes. This set provides the final template ID values to be used once the test environment @@ -394,23 +440,25 @@ Change History: - Fixed build issue where xmlsec-.jar was not being included amongst provided libraries, causing sample code runtime failures. -= 0.2 (DRAFT) = -========= +# = 0.2 (DRAFT) = + This is a draft release of sample code the PCEHR interfaces. This release works against the current interfaces. Known issues include: -1) CDA documents root value must be an OID. -2) UploadDocumentMetadata operations are not supported in this release. -= 0.1 (DRAFT) = -========= +1. CDA documents root value must be an OID. +2. UploadDocumentMetadata operations are not supported in this release. + +# = 0.1 (DRAFT) = + This is a draft release of sample code the PCEHR interfaces. This release works against the current interfaces. Known issues include: -1) MTOM does not work with uploadDocument, only retrieveDocument -2) CDA documents must follow older IGs and the root value must be an OID -3) getAuditView has a deserialization issue -4) UploadDocument and UploadDocumentMetadata operations are not supported in - this release. + +1. MTOM does not work with uploadDocument, only retrieveDocument +2. CDA documents must follow older IGs and the root value must be an OID +3. getAuditView has a deserialization issue +4. UploadDocument and UploadDocumentMetadata operations are not supported in + this release. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd2a882..8145ddc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,75 @@ # Contributing -**Audience:** people submitting patches or running this repository's CI locally. - -- **Build:** **JDK 8** and **Apache Maven 3.6.3+**. From the repo root: **`mvn -B -Dgpg.skip=true clean verify`**. Optional faster local **`verify`** without Javadoc: **`mvn -B -Pdev-javadoc-off -Dgpg.skip=true clean verify`**. Integration tests: **`mvn -B -Pintegration -Dgpg.skip=true clean test`**. Sample compile: **`mvn -B -Psample -Dgpg.skip=true -DskipTests=true clean compile`**. Shaded JAR: **`mvn -B -Pfat-jar -Dgpg.skip=true clean verify`**. Optional **`./build.sh`**, **`build.ps1`**. -- **Dependencies:** **`au.gov.nehta:pcehr-compiled-wsdl`** at **`pcehr.wsdl.version`** = **`${project.version}`** (**`1.6.3-SNAPSHOT`** during development). **Local SNAPSHOT:** **`mvn install`** in **[pcehr-compiled-wsdl-java](https://github.com/AuDigitalHealth/pcehr-compiled-wsdl-java)** at the **matching version** before **`verify`** here. -- **CI:** **`.github/workflows/ci.yml`** installs **`pcehr-compiled-wsdl-java`** then runs **`verify`** on **Temurin 8**. -- **Do not commit:** **`local.properties`**, real keystores, passwords, API tokens, or production URLs. See **`SECURITY.md`**. -- **Line endings:** configure Git **`core.autocrlf false`** on Windows before committing. -- **Optional WSDL codegen:** **`cd wsdls`**, **`./sync-lib.ps1`**, then **`ant -f build.xml generate-src`** (Apache Ant on PATH; see **`MAINTAINERS.md`**). **`WsdlsCodegenToolingTest`** (default Surefire) verifies **`wsdls/lib/provided/`** contains EE4J tooling and no Metro bundles. -- **Internals:** **`MAINTAINERS.md`**. +**Audience:** developers building or changing **this repository**. Integrators should use **README.md** and Maven Central coordinates. See **SECURITY.md** before committing. + +## Prerequisites + +- **JDK 17** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). +- **Maven 3.6.3+** on **`PATH`**. + +Dependencies resolve from **[Maven Central](https://central.sonatype.com/)** unless you are installing a **local SNAPSHOT** (below). + +## Versioning + +The **first number** of **`au.gov.nehta:mhr-b2b-client`** is the **Java SE** version that this client targets. **17.0.0** is the Java 17 Jakarta line with **15** facades. See **`README.md`**. + +**`mhr-b2b-client`** pins sibling **`au.gov.nehta`** libs (**`mhr-wsdl`**, **`common-library`**, **`smi-xsp`**, **`smi-common-utils`**) to **`${project.version}`**. Use the **same** version for those artifacts. + +## Build + +From the project root, after sibling libs are resolvable: + +```text +mvn -B "-Dgpg.skip=true" clean verify +``` + +| Goal | Command | +| -------------------------------- | ------------------------------------------------------------------ | +| Compile + attach sources/Javadoc | `mvn -B "-Dgpg.skip=true" clean verify` | +| Skip tests | `mvn -B "-Dgpg.skip=true" clean verify "-DskipTests=true"` | +| Skip Javadoc | `mvn -B -Pdev-javadoc-off "-Dgpg.skip=true" clean verify` | +| Integration tests | `mvn -B -Pintegration "-Dgpg.skip=true" clean test` | +| Sample compile | `mvn -B -Psample "-Dgpg.skip=true" -DskipTests=true clean compile` | +| Shaded JAR | `mvn -B -Pfat-jar "-Dgpg.skip=true" clean verify` | + +GPG signing is skipped by default (**`-Dgpg.skip=true`**). Release builds: **`-Dgpg.skip=false`**. Optional **`./build.sh`**, **`build.ps1`**. + +## Dependencies + +- Types: **`au.gov.nehta:mhr-wsdl`** at **`${project.version}`**. +- Shared libs: **`common-library`**, **`smi-xsp`**, **`smi-common-utils`** at **`${project.version}`**. +- Runtime SOAP stack: **`com.sun.xml.ws:jaxws-rt`** **4.0.5**. +- **`maven-enforcer-plugin`** rejects Metro **`webservices-*`** and legacy **`javax.xml.ws`**, **`javax.xml.bind`**, and **`javax.xml.soap`** APIs. + +## Local builds (unpublished artifacts) + +Install matching sibling **`au.gov.nehta`** libs first (same Java line: **`17.0.0-SNAPSHOT`**): + +```text +# in common-library-java / smi-xsp-java / smi-common-utils-java / mhr-wsdl-java +mvn -B "-Dgpg.skip=true" clean install + +# in mhr-b2b-client-java +mvn -B "-Dgpg.skip=true" clean verify +``` + +Integrators using GA versions from Maven Central do not need a source checkout. + +Maintainer notes: **MAINTAINERS.md**. + +## Optional WSDL codegen + +The default lifecycle does **not** run **`wsimport`**. To regenerate from **`wsdls/`**: + +```text +cd wsdls +./sync-lib.ps1 +ant -f build.xml generate-src +``` + +Apache Ant must be on **`PATH`**. **`WsdlsCodegenToolingTest`** (default Surefire) verifies **`wsdls/lib/provided/`** contains EE4J tooling and no Metro bundles. + +## Repository hygiene + +- **Do not commit** **`local.properties`**, real keystores, passwords, API tokens, or production URLs. See **SECURITY.md**. +- **Line endings:** the repository uses **LF** (see **`.gitattributes`**). On **Windows**, run **`git config core.autocrlf false`** in your clone before committing. diff --git a/LICENSE.txt b/LICENSE.txt index 2bb02e8..6403bbd 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,28 +1,245 @@ -Australian Digital Health Agency Production Disclaimer - +MHR B2B Client Java - licensing + +Copyright 2012 National E-Health Transition Authority Ltd (NEHTA). +Copyright 2021-2026 Australian Digital Health Agency (ADHA) and contributors. +See notices in individual source files where they differ. + +Unless otherwise indicated, this work is licensed under the Apache License, +Version 2.0. The complete license text is included below to satisfy section 4 of +that license (recipients must receive a copy of this License with the Work). + +================================================================================ +Apache License, Version 2.0 (canonical text) +================================================================================ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +================================================================================ +Additional terms - Australian Digital Health Agency Production Disclaimer +================================================================================ The Australian Digital Health Agency (as Licensor) grants You a licence to this Product subject to the terms of the Apache Licence (version 2.0), a copy of which is available at http://www.apache.org/licenses/LICENSE-2.0, and the following terms. - + This Product licensed under the Apache Licence and these terms may -be used within production software systems. It nevertheless remains -your responsibility to test and validate the use of this product -within your software and the limitation of liability provisions in +be used within production software systems. It nevertheless remains +your responsibility to test and validate the use of this product +within your software and the limitation of liability provisions in clause 8 of the Apache Licence continue to apply. -Despite clause 7 of the Apache Licence, if a condition or warranty -is implied by statute or law that cannot be excluded, then the -liability of a Contributor to the extent that it has contributed to -a breach of that condition or warranty is limited to one or more of -the following at its option: (a) in the case of goods, any one of -the following: the replacement of those goods or the re-supply of -equivalent goods; the repair of those goods; the payment of the -cost of replacing those or acquiring equivalent goods; or the -payment of the cost of having those goods repaired; and (b) in the -case of services: the supplying of those services again; or the +Despite clause 7 of the Apache Licence, if a condition or warranty +is implied by statute or law that cannot be excluded, then the +liability of a Contributor to the extent that it has contributed to +a breach of that condition or warranty is limited to one or more of +the following at its option: (a) in the case of goods, any one of +the following: the replacement of those goods or the re-supply of +equivalent goods; the repair of those goods; the payment of the +cost of replacing those or acquiring equivalent goods; or the +payment of the cost of having those goods repaired; and (b) in the +case of services: the supplying of those services again; or the payment of the cost of having those services supplied again. - -A term which is given a meaning in the Apache Licence, has the same -meaning when used in these terms. +A term which is given a meaning in the Apache Licence, has the same +meaning when used in these terms. diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 3296f70..11fdc27 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -1,25 +1,80 @@ # Maintainer notes -**Audience:** people changing the build, dependency coordinates, tests, or WSDL layout. +**Audience:** people changing the **`mhr-b2b-client`** build, dependency coordinates, tests, or WSDL layout - not library integrators. Integrators should use **README.md**, published Javadoc, and **`pom.xml`** coordinates. -## Branch scope (Java 8 / `javax`) +Paths are relative to the repository root (directory containing **`pom.xml`**). This Git repository is **`mhr-b2b-client-java`**; the Maven artifact id remains **`mhr-b2b-client`**. -- **Goal:** Java **8** bytecode (`maven.compiler.release` **8**) with **`javax.xml.ws`** / JAXB in application code; SOAP types **`au.net.electronichealth.*`** come from **`au.gov.nehta:pcehr-compiled-wsdl`** at **`pcehr.wsdl.version`**. This artifact does **not** run **`wsimport`** in the default lifecycle. -- **`wsdls/`** holds the canonical PCEHR B2B WSDL/XSD tree (committed in Git — not HI-style licensed material). See **`wsdls/readme.txt`**. +## Versioning -## Java / JAX stack +The **first number** of **``** is the **Java SE** target of **this** client JAR. -- **`ee4j.jaxws.version`** — **`com.sun.xml.ws:jaxws-rt`** **2.3.7** (last **2.3.x** for Java 8). Exclude legacy **`webservices-rt`** from **`common-library`** and **`clinical-document-packaging-library`** only. -- **`pcehr.wsdl.version`** — **`${project.version}`**; coordinate GA releases with **`pcehr-compiled-wsdl-java`**. -- **Enforcer** bans **`com.sun.xml.ws:webservices-*`** (Metro bundle). Application code uses **`javax.*`** only; EE4J **`jaxws-rt` 2.3.x** may transitively pull javax-bridge **`jakarta.*` API** JARs — that is expected on this line. +| Maven version | Java SE | +| ------------- | ------- | +| **11.0.0** | **11** | +| **17.0.0** | **17** | +| **21.0.0** | **21** | +| **24.0.0** | **24** | + +**Documentation convention:** README, CONTRIBUTING, CHANGELOG, and integrator-facing text use **version numbers only** - never Git branch names. + +| Version | Java | XML APIs | Facades | +| ---------- | ---- | ------------------------- | ---------------- | +| **11.0.0** | 11 | **Jakarta** XML WS / Bind | **15** (MHR B2B) | +| **17.0.0** | 17 | **Jakarta** XML WS / Bind | **15** (MHR B2B) | +| **21.0.0** | 21 | **Jakarta** XML WS / Bind | **15** (MHR B2B) | +| **24.0.0** | 24 | **Jakarta** XML WS / Bind | **15** (MHR B2B) | + +**Git branch mapping (maintainers / checkout only - do not use in integrator docs):** + +| Version | Official Git branch | +| ---------- | ------------------- | +| **11.0.0** | `java-11` | +| **17.0.0** | `java-17` | +| **21.0.0** | `java-21` | +| **24.0.0** | `java-24` | + +Artifact id stays **`mhr-b2b-client`**; the version distinguishes the Java SE line. Pair **`mhr-wsdl`**, **`common-library`**, **`smi-xsp`**, and **`smi-common-utils`** at the **same** version and the **same** branch names on the matching sibling repositories. + +On a given branch, **do not change the first number** of **``**. A new Java SE target is a **new branch**, not a bump on this one. + +**This checkout (`17.0.0-SNAPSHOT`):** Java **17**, **Jakarta** facade clients, sibling **`au.gov.nehta`** libs at **`${project.version}`**, **15** facades (no **`wsimport`** in the default lifecycle). Stack and **`.github/workflows/ci.yml`** (branch **`java-17`**, JDK **17**, checkout **`mhr-wsdl-java`** **`java-17`**) below apply to **this line only**. + +Java packages and type names use **`mhr`**. SOAP/XML namespaces, element names, and operation names stay the published B2B contract (**`PCEHRHeader`**, **`registerPCEHR`**, **`/pcehr/`** namespace URIs). + +## Artifact + +- **`au.gov.nehta:mhr-b2b-client`** - facade clients, TLS, signing. +- Types and classpath WSDL come from **[mhr-wsdl-java](https://github.com/AuDigitalHealth/mhr-wsdl-java)**. + +## Layout + +| Path | Role | +| ----------------------------------------------- | ------------------------------------------------------------------------------- | +| `src/main/java/au/gov/nehta/vendorlibrary/mhr/` | Facade clients | +| `wsdls/` | Canonical PCEHR B2B WSDL/XSD tree (kept in Git; not HI-style licensed material) | +| `src/sample/java/` | Sample sources (**`-Psample`**) | +| `src/test/java/` | Offline unit tests; **`-Pintegration`** widens Surefire | + +See **`wsdls/readme.txt`**. + +## Java / JAX stack (`17.0.0`) + +- **`maven.compiler.release` 17** +- **`ee4j.jaxws.version`** - **`com.sun.xml.ws:jaxws-rt`** **4.0.5**. Exclude legacy **`webservices-rt`** from **`common-library`** and **`clinical-document-packaging-library`**. +- Sibling **`au.gov.nehta`** deps (**`mhr-wsdl`**, **`common-library`**, **`smi-xsp`**, **`smi-common-utils`**) at **`${project.version}`**; coordinate GA releases across those repositories. +- **`maven-enforcer-plugin`:** bans Metro **`webservices-*`** and legacy **`javax.xml.ws`**, **`javax.xml.bind`**, and **`javax.xml.soap`** APIs. Application code uses **Jakarta** XML APIs. +- **`maven-gpg-plugin`:** skipped unless **`-Dgpg.skip=false`** +- **`maven-javadoc-plugin`:** **`doclint=none`**, **`failOnWarnings=false`** (aligned with other Java **17** **`au.gov.nehta`** lines) +- Default package is a thin JAR; optional **`-Pfat-jar`** attaches classifier **`all`**. +- **`.github/workflows/ci.yml`:** GitHub Actions on **`java-17`**, JDK **17**; installs **`mhr-wsdl`** **`17.0.0-SNAPSHOT`** then **`verify`** ## Default tests -Surefire default **`includes`** run offline-safe tests only. **`integration`** profile widens to **`**/*Test.java`** for mutual-TLS suites with local keystores. +Surefire default **`includes`** run offline-safe tests only (**`JaxwsRuntimeSmokeTest`**, **`MhrWsdlArtifactSmokeTest`**, **`MhrFacadeCoverageTest`**, and other unit tests). **`MhrFacadeCoverageTest`** locks **15** facades and **getView** **7** clinical views against **mhr-b2b-client-dotnet**. **`MhrWsdlArtifactSmokeTest`** loads **`au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.MHRProfileService`**. **`integration`** profile widens to **`**/*Test.java`** for mutual-TLS suites with local keystores. ## Optional `wsdls/` Ant wsimport -The default **`mhr-b2b-client`** build uses **`pcehr-compiled-wsdl`** from Maven. To regenerate SOAP types locally: +The default **`mhr-b2b-client`** build uses **`mhr-wsdl`** from Maven. To regenerate SOAP types locally: ```text cd wsdls @@ -27,22 +82,32 @@ cd wsdls ant -f build.xml generate-src ``` -Tooling lives in **`wsdls/lib/provided/`** (**`jaxws-tools`**, **`jaxws-rt`**, **`ant-contrib`** from Maven Central — **not** legacy Metro **`webservices-*`**). Commit updated JARs after **`sync-lib`**. **`ee4j.jaxws.version`** in **`ee4j-jaxws-lib-pom.xml`** must match the root **`pom.xml`**. +Tooling lives in **`wsdls/lib/provided/`** (**`jaxws-tools`**, **`jaxws-rt`**, **`ant-contrib`** from Maven Central - **not** legacy Metro **`webservices-*`**). Keep updated JARs in Git after **`sync-lib`**. **`ee4j.jaxws.version`** in **`ee4j-jaxws-lib-pom.xml`** must match the root **`pom.xml`**. + +**`WsdlsCodegenToolingTest`** (default Surefire) checks tooling JARs, WSDL tree presence, version alignment, and absence of Metro **`webservices-*`** filenames - no Ant run in CI. + +## Contributors vs release publisher (`pom.xml`) + +**Contributors (PRs, ordinary changes):** Do not change **``** (stay on **`-SNAPSHOT`** unless the maintainer requests a bump), **``**, or **`distributionManagement`**. If a maintainer requests a SNAPSHOT bump on this branch, change only the trailing numbers (**`17.0.1-SNAPSHOT`**), never the Java SE digit. Leave **`maven-gpg-plugin`** **`skip`** **`true`** so default **`mvn verify`** does not require a signing key. Record user-visible work under **`CHANGELOG.md`** in the **`= =`** block that matches **`pom.xml`** **``**. -**`WsdlsCodegenToolingTest`** (default Surefire) checks tooling JARs, WSDL tree presence, version alignment, and absence of Metro **`webservices-*`** filenames — no Ant run in CI. +**Release publisher:** In the release change set: set **``** to the GA coordinate (no **`-SNAPSHOT`**); set **``** to the Git tag you will publish (match existing tag naming). Move **`CHANGELOG.md`** bullets from the snapshot section into a new **`= =`** section; add a fresh **`-SNAPSHOT`** block for the next development cycle. Deploy via Sonatype Central Portal (**`central-publishing-maven-plugin`**; copy **`settings.xml.example`** -> **`settings.xml`**, server id **`central`**). See **Release** below. ## Release -Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). Copy **`settings.xml.example`** → **`settings.xml`**, server id **`central`**. +Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). Copy **`settings.xml.example`** -> **`settings.xml`**, server id **`central`**. -**Parallel release lines (maintainers only):** each Git branch publishes a **different Maven version** — integrators choose by coordinate, not branch name. +**Parallel release lines (maintainers only):** each Git branch of **this** repository publishes a **different Maven version** of **`mhr-b2b-client`**. Integrators choose by coordinate, not branch name. The first number of that version is the targeted Java SE version. Run **`release:prepare` / `release:perform`** (or manual deploy) **on that branch** (not detached HEAD). -| Branch | Java | MHR client / WSDL version | Facades | -| ------ | ---- | ------------------------- | ------- | -| **`java-8-javax-full-wsdl`** | 8 / javax | **1.6.3** | 15 | -| **`java-11-jakarta-full-wsdl`** | 11 / Jakarta | **1.7.0** | 26 | +| Branch | Java | `mhr-b2b-client` / siblings | Facades | +| ------------- | ------------ | --------------------------- | ------- | +| **`java-11`** | 11 / Jakarta | **11.0.0** | 15 | +| **`java-17`** | 17 / Jakarta | **17.0.0** | 15 | +| **`java-21`** | 21 / Jakarta | **21.0.0** | 15 | +| **`java-24`** | 24 / Jakarta | **24.0.0** | 15 | -Release **`pcehr-compiled-wsdl`** and **`mhr-b2b-client`** at the **same GA version** on the matching branch pair before integrators upgrade. +**Order:** publish **`mhr-wsdl`** and other sibling **`au.gov.nehta`** libs first. This client cannot complete **`verify`** / **`release:perform`** until those coordinates are on Central (or installed locally). + +**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`17.0.0`** then **`17.0.1-SNAPSHOT`**). ### SNAPSHOT or manual GA @@ -50,22 +115,41 @@ Release **`pcehr-compiled-wsdl`** and **`mhr-b2b-client`** at the **same GA vers 2. **`mvn -B "-Prelease" clean verify`** 3. **`mvn -B "-Prelease" deploy`** -Git/SCM settings for **`maven-release-plugin`** live in **`pom.xml`** properties (**`scm.repo.url`**, **`release.*`**). Tags default to **`{artifactId}-{version}`** (e.g. **`mhr-b2b-client-1.7.0`**). +Git/SCM settings for **`maven-release-plugin`** live in **`pom.xml`** properties (**`scm.repo.url`**, **`release.*`**). Tags default to **`{artifactId}-{version}`** (e.g. **`mhr-b2b-client-17.0.0`**). ### Automated GA (`maven-release-plugin`) -Run on the **target branch** with a **clean** working tree. The plugin commits version bumps, creates the release tag, deploys from the tag checkout, bumps to the next **`-SNAPSHOT`**, and **pushes branch + tag** (**`pushChanges`** / **`remoteTagging`** in **`pom.xml`**). Git remote credentials (SSH or HTTPS) must work non-interactively. +Run on the **target branch** with a **clean** working tree. The plugin bumps versions, creates the release tag, deploys from the tag checkout, bumps to the next **`-SNAPSHOT`**, and updates the remote branch and tag (**`pushChanges`** / **`remoteTagging`** in **`pom.xml`**). Git remote credentials (SSH or HTTPS) must work non-interactively. ```text -mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=1.7.0 -DdevelopmentVersion=1.7.1-SNAPSHOT -Dtag=mhr-b2b-client-1.7.0 +mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=17.0.0 -DdevelopmentVersion=17.0.1-SNAPSHOT -Dtag=mhr-b2b-client-17.0.0 ``` -Replace versions and **`-Dtag`** for the branch you are on (**`pcehr-compiled-wsdl-1.6.3`**, **`mhr-b2b-client-1.6.3`**, etc.). Omit **`-D…`** only if you accept interactive prompts. +Replace **`-DreleaseVersion`**, **`-DdevelopmentVersion`**, and **`-Dtag`** for the branch you are on. Omit **`-D...`** only if you accept interactive prompts. -**After success:** confirm the artifact on Central; repeat on the paired types/client repo. No extra Git steps unless push failed (then **`git push origin `** and **`git push origin `**). +**After success:** confirm sibling libs then **`mhr-b2b-client`** GA on Central. If the plugin did not update the remote, send the release branch and the release tag from a local checkout. **`-Dgpg.skip=false`** is equivalent to **`-Prelease`** for signing. +## Changelog and releases + +**`CHANGELOG.md`** uses **`= version =`** section headers. Match the snapshot header to **`pom.xml`** **``** until the publisher cuts GA. + +## New Java SE line + +When adding a line (e.g. Java **25**): create **`java-25`** in **this** repository from the nearest existing client line; set **``** first number to **25** (e.g. **`25.0.0-SNAPSHOT`**); set **`maven.compiler.release`**, JAX-WS / JAXB coordinates, CI **`java-version`** / branch filter, and docs to that line. Do not retarget an existing branch. + +The matching sibling **`au.gov.nehta`** lines must exist first. + +## Public remote checklist + +Before sending work to a **public** remote: + +1. **`git status`** - no keystores, **`settings.xml`**, or **`local.properties`** staged. +2. No **`target/`** in the change set. +3. **`mvn -B "-Dgpg.skip=true" clean verify`** passes (with sibling libs installed or on Central). +4. **CHANGELOG.md** and **`pom.xml`** version reflect the release line. + ## Copyright -Copyright 2012 NEHTA. Copyright 2021-2026 ADHA. Licensed under Apache 2.0 — see **LICENSE.txt**. +Copyright 2012 NEHTA. Copyright 2021-2026 ADHA. Apache License 2.0 - see **LICENSE.txt**. diff --git a/README.md b/README.md index dcf99fe..ed27ef6 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,73 @@ # MHR B2B Client -Maven library for Australia's **My Health Record (PCEHR) B2B** SOAP APIs over **JAX-WS**. +Maven artifact **`au.gov.nehta:mhr-b2b-client`** - Java facade clients for Australia's **My Health Record (MHR) B2B** SOAP APIs over **JAX-WS**. -**Audience:** applications that depend on **`au.gov.nehta:mhr-b2b-client`**, supply mutual-TLS credentials and ADHA-registered product metadata, and call PCEHR record access, document exchange, views, and templates. To **build or change this repository**, see **`CONTRIBUTING.md`**, **`MAINTAINERS.md`**, and **`SECURITY.md`**. +For generated types and classpath WSDL, use **[mhr-wsdl-java](https://github.com/AuDigitalHealth/mhr-wsdl-java)**. This repository supplies **facade clients**, **TLS**, and **SOAP signing**. The pairing is the same as **`hi-wsdl`** / **`hi-b2b-client`**: same Maven version, types JAR first. -Traffic uses **HTTPS with mutual TLS** and **signed** SOAP. You need ADHA registration, test or production **certificates**, and **endpoint URLs** before live calls succeed. +**Audience:** applications that depend on **`au.gov.nehta:mhr-b2b-client`**, supply mutual-TLS credentials and ADHA-registered product metadata, and call record access, document exchange, views, and templates. To **build or change this repository**, see **`CONTRIBUTING.md`**, **`MAINTAINERS.md`**, and **`SECURITY.md`**. ---- +Traffic uses **HTTPS with mutual TLS** and **signed** SOAP. You need ADHA registration, test or production **certificates**, and **endpoint URLs** before live calls succeed. ## Dependency +Published releases are consumed from **[Maven Central](https://central.sonatype.com/)**. Use a **``** that matches your JDK (see **Versioning**). + ```xml au.gov.nehta mhr-b2b-client - 1.6.3-SNAPSHOT + 17.0.0 ``` -**Runtime:** JDK **8+** (see **`maven.compiler.release`** in **`pom.xml`**). Maven pulls EE4J **`jaxws-rt`** **2.3.x** and SOAP types from **`au.gov.nehta:pcehr-compiled-wsdl`** at **`pcehr.wsdl.version`** = **`${project.version}`**. +**This line (`17.0.0`):** Java **17**, **Jakarta XML Web Services / JAXB**, **15** facade clients. Runtime SOAP stack is Eclipse EE4J **`com.sun.xml.ws:jaxws-rt`** **4.0.5**. Pair with **`au.gov.nehta:mhr-wsdl`** **`17.0.0`**. Sibling libs **`common-library`**, **`smi-xsp`**, and **`smi-common-utils`** use the same Maven version. Do **not** use legacy Metro **`webservices-*`** bundles. + +When **`mhr-wsdl`** is also on the classpath, use the **same** Maven version for both artifacts. -Application code uses **`javax.xml.ws`**, **`javax.xml.bind`**, and related **`javax`** APIs on this branch. +--- -### Local development (SNAPSHOT) +## Versioning -When both repositories are unpublished, install the types JAR **first** at the **same Maven version** (**`1.6.3-SNAPSHOT`**): +The **first number** of the Maven version is the **Java SE** version that this client targets. **`mhr-b2b-client`** and **`mhr-wsdl`** always use the **same** version on a given line (same SNAPSHOT or GA). + +| Maven version | Java SE | XML stack | Facades | +| ------------- | ------- | --------------------------------------- | ---------------- | +| **11.0.0** | **11** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** | **15** (MHR B2B) | +| **17.0.0** | **17** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** | **15** (MHR B2B) | +| **21.0.0** | **21** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** | **15** (MHR B2B) | +| **24.0.0** | **24** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** | **15** (MHR B2B) | + +Pick the coordinate that matches your JDK. Do not mix **`mhr-b2b-client`** versions with **`mhr-wsdl`** from a different line. All published versions are on **[Maven Central](https://central.sonatype.com/)**. + +Java packages and type names use **`mhr`** (`au.gov.nehta.vendorlibrary.mhr`, **`DoesMHRExistClient`**, **`MHRHeader`**, **`RegisterMHRClient`**). SOAP/XML namespaces, element names, and operation names stay the published B2B contract (`http://ns.electronichealth.net.au/pcehr/...`, **`PCEHRHeader`**, **`registerPCEHR`**). + +--- + +## Note + +The **17.0.0** JAR ships **15** MHR B2B facade clients on **Jakarta**. That set matches the logical B2B interfaces in **mhr-b2b-client-dotnet** (including **getView** and its **7** clinical views). See **ADHA-THIRD-PARTY-SCOPE.md**. + +--- + +## Local development (SNAPSHOT) + +This repository builds **`17.0.0-SNAPSHOT`**. Install unpublished sibling **`au.gov.nehta`** libs at the **same Maven version** first (**`mhr-wsdl`**, **`common-library`**, **`smi-xsp`**, **`smi-common-utils`**), then **`verify`** here: ```text -# 1) pcehr-compiled-wsdl-java +# 1) sibling au.gov.nehta libs (same version) mvn -B "-Dgpg.skip=true" clean install # 2) mhr-b2b-client-java mvn -B "-Dgpg.skip=true" clean verify ``` -If Maven warns that a **GA** POM is missing, remove stale **`au.gov.nehta:pcehr-compiled-wsdl`** entries from your local Maven repository and reinstall the SNAPSHOT. **`mvn clean`** does not clear the local Maven cache. +If Maven warns that a **GA** POM is missing (for example **`17.0.0`** before Central publish), clear stale **`au/gov/nehta/`** entries in your **local Maven repository** (folders with only **`.lastUpdated`** files) and reinstall the SNAPSHOTs. **`mvn clean`** in this project does not clear the local repository cache. --- ## WSDL/XSD -PCEHR B2B WSDL and XSD are committed under **`wsdls/src/main/resources/`**. They are **not** separate ADHA-licensed artefacts (contrast with **hi-b2b-client-java** HI contracts). The published facade JAR uses generated types from **`pcehr-compiled-wsdl`**; the in-repo tree is the canonical contract reference. See **`wsdls/readme.txt`**. +PCEHR B2B WSDL and XSD are committed under **`wsdls/`**. They are **not** separate ADHA-licensed artefacts (contrast with **hi-b2b-client-java** HI contracts). The published facade JAR uses generated types from **`mhr-wsdl`**; the in-repo tree is the canonical contract reference. See **`wsdls/readme.txt`**. ### Optional: regenerate types with Ant (maintainers) @@ -52,19 +79,19 @@ cd wsdls ant -f build.xml generate-src # requires Apache Ant on PATH ``` -Tooling under **`wsdls/lib/provided/`** is **Eclipse EE4J** (**`jaxws-tools`**, **`jaxws-rt`**) — not legacy Metro **`webservices-*`**. Offline test **`WsdlsCodegenToolingTest`** guards this layout in CI. +Tooling under **`wsdls/lib/provided/`** is **Eclipse EE4J** (**`jaxws-tools`**, **`jaxws-rt`**) - not legacy Metro **`webservices-*`**. Offline test **`WsdlsCodegenToolingTest`** guards this layout in CI. --- ## What you configure in your application -Construct a facade client (for example **`DoesPCEHRExistClient`**) with: +Construct a facade client (for example **`DoesMHRExistClient`**) with: -| Item | Purpose | -| ---- | ------- | -| **`SSLSocketFactory`** | Mutual TLS to the PCEHR endpoint. | -| Private key + certificate | TLS and SOAP signing. | -| Endpoint URL | SOAP service URL from your registration. | +| Item | Purpose | +| ------------------------------------- | ---------------------------------------- | +| **`SSLSocketFactory`** | Mutual TLS to the PCEHR endpoint. | +| Private key + certificate | TLS and SOAP signing. | +| Endpoint URL | SOAP service URL from your registration. | | Product / vendor / user qualified IDs | Values issued for your software product. | Load keystores, truststores, and identifiers from your platform. Do not commit credentials to source control (**`SECURITY.md`**). @@ -73,43 +100,53 @@ Load keystores, truststores, and identifiers from your platform. Do not commit c ## Client classes -Package base: **`au.gov.nehta.vendorlibrary.pcehr.clients`**. +Package base: **`au.gov.nehta.vendorlibrary.mhr.clients`**. -| Area | Examples | -| ---- | -------- | -| Record access | `DoesPCEHRExistClient`, `GainPCEHRAccessClient` | -| Document exchange | `UploadDocumentClient`, `GetDocumentClient`, `RemoveDocumentClient` | -| Views | `GetViewClient`, `GetDocumentListClient`, `GetAuditViewClient` | -| Templates | `GetTemplateClient`, `SearchTemplateClient` | +| Area | Examples | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Record access | `DoesMHRExistClient`, `GainMHRAccessClient` | +| Document exchange | `UploadDocumentClient`, `GetDocumentClient`, `RemoveDocumentClient`, `UploadDocumentMetadataClient` | +| Registration | `RegisterMHRClient` | +| Views | `GetViewClient`, `GetDocumentListClient`, `GetAuditViewClient`, `GetChangeHistoryViewClient`, `GetIndividualDetailsViewClient`, `GetRepresentativeListClient` | +| Templates | `GetTemplateClient`, `SearchTemplateClient` | --- ## Build and test -From the repository root: +From the repository root (after sibling **`au.gov.nehta`** libs are resolvable): ```text mvn -B "-Dgpg.skip=true" clean verify ``` - Default Surefire: **offline** unit tests only. -- Full mutual-TLS integration suite: **`mvn -B -Pintegration -Dgpg.skip=true clean test`** with local keystores and endpoints configured. -- Sample sources: **`mvn -B -Psample -Dgpg.skip=true -DskipTests=true clean compile`** -- Shaded JAR (classifier **`all`**): **`mvn -B -Pfat-jar -Dgpg.skip=true clean verify`** +- Full mutual-TLS integration suite: **`mvn -B -Pintegration "-Dgpg.skip=true" clean test`** with local keystores and endpoints configured. +- Sample sources: **`mvn -B -Psample "-Dgpg.skip=true" -DskipTests=true clean compile`** +- Shaded JAR (classifier **`all`**): **`mvn -B -Pfat-jar "-Dgpg.skip=true" clean verify`** Optional: **`./build.sh`**, **`build.ps1`**. --- -## Publishing and public hosting +## Related repositories -This repository is intended for public Git hosting. Do not commit secrets, real keystores, or production endpoint credentials. **`local.properties`** is gitignored. +| Repository | Role | +| --------------------------------------------------------------------------- | -------------------------------------------------------- | +| [mhr-wsdl-java](https://github.com/AuDigitalHealth/mhr-wsdl-java) | Generated MHR SOAP types (**17.0.0**, Java 17 / Jakarta) | +| [hi-b2b-client-java](https://github.com/AuDigitalHealth/hi-b2b-client-java) | Healthcare Identifiers client (separate domain) | ---- +## Documentation -## Related repositories +| Document | Audience | +| ------------------------- | ------------------------------- | +| **README.md** (this file) | Integrators | +| **CONTRIBUTING.md** | Contributors | +| **MAINTAINERS.md** | Releases and tooling | +| **SECURITY.md** | Secrets and reporting | +| **CHANGELOG.md** | Release history | +| **LICENSE.txt** | Apache License 2.0 + ADHA terms | + +## License -| Repository | Role | -| ---------- | ---- | -| [pcehr-compiled-wsdl-java](https://github.com/AuDigitalHealth/pcehr-compiled-wsdl-java) | Generated PCEHR SOAP types (**1.6.3**, Java 8 / `javax`) | -| [hi-b2b-client-java](https://github.com/AuDigitalHealth/hi-b2b-client-java) | Healthcare Identifiers client (separate domain) | +Apache License 2.0. See **LICENSE.txt**. diff --git a/SECURITY.md b/SECURITY.md index 820d189..53634e7 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,15 +1,26 @@ # Security +## If you integrate this library + +Do **not** embed mutual-TLS private keys, keystore passwords, or production PCEHR B2B URLs in source control in **your** application. Load secrets from your platform's vault, environment, or secure configuration. + ## Reporting issues -For **security vulnerabilities in this library**: +For **security vulnerabilities in this library** (not routine support): + +1. Prefer **GitHub private vulnerability reporting** for this repository if it is enabled (**Security** tab, **Report a vulnerability**). +2. Otherwise use your organisation's usual channel for **ADHA / AuDigitalHealth** repositories. Do **not** post exploit details, live credentials, or production URLs in a **public issue** before triage. + +## Supported versions -1. Prefer **GitHub private vulnerability reporting** if enabled (**Security** tab). -2. Otherwise use your organisation's channel for **ADHA / AuDigitalHealth** repositories. Do **not** post exploit details or live credentials in public issues. +| Version | Supported | +| -------- | --------- | +| 17.0.0 | Yes | +| 11.0.0 | Yes | ## This repository -- **Do not commit secrets to git:** passwords, API tokens, private keys, real mutual-TLS keystores, or production endpoint URLs — including in tests, samples, or documentation. -- **`local.properties`** is gitignored. Never commit real PCEHR credentials or keystores. -- **`src/test/resources/**/*.jks`** and **`src/sample/resources/**/*.jks`** are gitignored. Provide test keystores locally for **`-Pintegration`** only. -- **`wsdls/lib/provided/`** contains only public Maven Central build tooling (EE4J JAX-WS); no credentials or licensed HI-style contract bundles. +- **Do not commit secrets to git.** That includes passwords, API tokens, private keys, real mutual-TLS keystores, production or staging PCEHR endpoint URLs, and vendor registration material, even in comments, test fixtures, sample code, or tracked documentation. +- **PCEHR WSDL/XSD** under **`wsdls/src/main/resources/`** are part of this open-source product (not separate ADHA-licensed artefacts like HI contracts in **hi-b2b-client-java**). Do not commit credentials alongside them. +- **`local.properties.example`** and **`settings.xml.example`** are templates. Copy to **`local.properties`** / **`settings.xml`** (gitignored), fill in values, and never commit populated files. +- Historical integration tests may reference cert-environment hostnames in **`src/test/java`**. Treat those as examples only; rotate credentials if they were ever real. diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..4193776 --- /dev/null +++ b/build.bat @@ -0,0 +1,33 @@ +@echo off +setlocal +set "P=" +set "WS=" +if /i "%~1"=="shaded" set "P=-Pfat-jar " +if /i "%~1"=="-shaded" set "P=-Pfat-jar " +if /i "%~1"=="--shaded" set "P=-Pfat-jar " +if /i "%~1"=="wsimport" set "WS=-Pwsimport " +if /i "%~1"=="-wsimport" set "WS=-Pwsimport " +if /i "%~1"=="--wsimport" set "WS=-Pwsimport " +if not "%~1"=="" if not defined P if not defined WS ( + echo Unknown argument: %~1 >&2 + echo Optional: shaded ^| wsimport >&2 + exit /b 2 +) +if defined P if defined WS ( + echo Use either shaded or wsimport, not both. >&2 + exit /b 2 +) +pushd "%~dp0" || exit /b 1 +set "SARGS=" +if defined MVN_SETTINGS set "SARGS=-s %MVN_SETTINGS% " +if defined WS ( + echo Building mhr-b2b-client JAR (with in-repo wsimport validation) +) else if defined P ( + echo Building mhr-b2b-client FAT/UBER JAR +) else ( + echo Building mhr-b2b-client JAR +) +mvn -B %SARGS%%WS%%P%-Dgpg.skip=true clean verify +set "EXIT=%ERRORLEVEL%" +popd +exit /b %EXIT% diff --git a/pom.xml b/pom.xml index f9f0a47..d84f801 100644 --- a/pom.xml +++ b/pom.xml @@ -9,9 +9,9 @@ au.gov.nehta mhr-b2b-client - 1.6.4-SNAPSHOT + 17.0.0-SNAPSHOT MHR B2B client - My Health Record B2B client (Java 8 / javax) + My Health Record B2B client (Java 17 / Jakarta) https://github.com/AuDigitalHealth/mhr-b2b-client-java @@ -64,7 +64,7 @@ - 8 + 17 UTF-8 ${encoding} ${encoding} @@ -83,29 +83,25 @@ true true [maven-release-plugin] - - 2.3.7 + + 4.0.5 4.13.2 - 3.17.0 - 2.18.0 - 1.2.2 - 1.2.1 + 3.20.0 + 2.22.0 3.5.0 3.15.0 - 3.5.5 + 3.5.6 3.12.0 3.4.0 3.1.4 3.3.1 - 0.9.0 + 0.11.0 3.6.1 3.2.8 3.4.2 3.6.2 - 0.8.14 + 0.8.15 3.6.2 - - ${project.version} -Xmx1024m @@ -113,7 +109,7 @@ au.gov.nehta common-library - ${nehta.lib.version} + ${project.version} com.sun.xml.ws @@ -124,12 +120,12 @@ au.gov.nehta smi-xsp - ${nehta.xsp.lib.version} + ${project.version} au.gov.nehta smi-common-utils - ${nehta.xsp.lib.version} + ${project.version} com.sun.xml.ws @@ -148,8 +144,8 @@ au.gov.nehta - pcehr-compiled-wsdl - ${pcehr.wsdl.version} + mhr-wsdl + ${project.version} junit @@ -217,8 +213,11 @@ com.sun.xml.ws:webservices-api com.sun.xml.ws:webservices-extra com.sun.xml.ws:webservices-extra-api + javax.xml.ws:* + javax.xml.bind:* + javax.xml.soap:* - Use Eclipse EE4J jaxws-rt, not legacy Metro webservices-* bundles. + Use Eclipse EE4J jaxws-rt and Jakarta XML APIs, not legacy Metro / javax JAX-WS, JAXB, or SOAP APIs. @@ -249,8 +248,8 @@ false false - true - all + false + none false ${encoding} ${maven.compiler.release} @@ -313,7 +312,8 @@ **/MetadataUtilsOrgIDNameTest.java **/MetadataUtilsTimeTest.java **/OIDUtilTest.java - **/PcehrWsdlArtifactSmokeTest.java + **/MhrWsdlArtifactSmokeTest.java + **/MhrFacadeCoverageTest.java **/WsdlsCodegenToolingTest.java diff --git a/src/build.xml b/src/build.xml index 7639b75..42e818d 100644 --- a/src/build.xml +++ b/src/build.xml @@ -202,7 +202,7 @@ under the License. failOnError="true"> - + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/Client.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/Client.java similarity index 97% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/Client.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/Client.java index 08a0665..d00c210 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/Client.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/Client.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common; +package au.gov.nehta.vendorlibrary.mhr.clients.common; import java.security.PrivateKey; import java.security.cert.X509Certificate; @@ -19,15 +19,15 @@ import java.util.List; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.BindingProvider; -import javax.xml.ws.Service; -import javax.xml.ws.handler.Handler; -import javax.xml.ws.soap.SOAPBinding; +import jakarta.xml.ws.BindingProvider; +import jakarta.xml.ws.Service; +import jakarta.xml.ws.handler.Handler; +import jakarta.xml.ws.soap.SOAPBinding; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.handler.IMTOMHandler; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.handler.SecurityHandler; +import au.gov.nehta.vendorlibrary.mhr.clients.common.handler.IMTOMHandler; +import au.gov.nehta.vendorlibrary.mhr.clients.common.handler.SecurityHandler; import au.gov.nehta.vendorlibrary.ws.WebServiceClientUtil; import au.gov.nehta.vendorlibrary.ws.handler.LoggingHandler; import au.gov.nehta.xsp.CertificateValidationException; @@ -311,3 +311,4 @@ public final PortType getPort() { return port; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/DateParsePatterns.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/DateParsePatterns.java similarity index 98% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/DateParsePatterns.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/DateParsePatterns.java index ca38b79..0f31f56 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/DateParsePatterns.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/DateParsePatterns.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.constant; +package au.gov.nehta.vendorlibrary.mhr.clients.common.constant; /** * The various date parse patterns supported in the context of CDA documents. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/FormatTypes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/FormatTypes.java similarity index 88% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/FormatTypes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/FormatTypes.java index 79ba9a5..67bcb0b 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/FormatTypes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/FormatTypes.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.constant; +package au.gov.nehta.vendorlibrary.mhr.clients.common.constant; /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.FormatTypes} + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.constant.FormatTypes} * Enum of format strings used with String.Format(). */ public enum FormatTypes { diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/Separators.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/Separators.java similarity index 93% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/Separators.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/Separators.java index 7575571..8d3ed11 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/Separators.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/Separators.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.constant; +package au.gov.nehta.vendorlibrary.mhr.clients.common.constant; /** * Commonly used separator constants. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XDSConstants.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XDSConstants.java similarity index 99% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XDSConstants.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XDSConstants.java index ca8865a..2f9d3a3 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XDSConstants.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XDSConstants.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.constant; +package au.gov.nehta.vendorlibrary.mhr.clients.common.constant; /** * Constants used by IHE XDS services. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XMLNamespaces.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XMLNamespaces.java similarity index 81% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XMLNamespaces.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XMLNamespaces.java index 42c199d..bfed6fb 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XMLNamespaces.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XMLNamespaces.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.constant; +package au.gov.nehta.vendorlibrary.mhr.clients.common.constant; /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces} XML namespaces used in generating a package. + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces} XML namespaces used in generating a package. */ public enum XMLNamespaces { @@ -105,10 +105,10 @@ public String getNamespace() { } /** - * Retrieves a {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces} based on a supplied prefix. + * Retrieves a {@link au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces} based on a supplied prefix. * * @param prefix Prefix to search for. - * @return Corresponding {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces} or null. + * @return Corresponding {@link au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces} or null. */ public static XMLNamespaces findByPrefix(String prefix) { for (XMLNamespaces v : values()) { @@ -120,10 +120,10 @@ public static XMLNamespaces findByPrefix(String prefix) { } /** - * Retrieves a {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces} based on a supplied namespace URI. + * Retrieves a {@link au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces} based on a supplied namespace URI. * * @param namespace Namespace URI to search for. - * @return Corresponding {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces} or null. + * @return Corresponding {@link au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces} or null. */ public static XMLNamespaces findByNamespace(String namespace) { for (XMLNamespaces v : values()) { diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XPathExpressions.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XPathExpressions.java similarity index 99% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XPathExpressions.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XPathExpressions.java index 4b01563..329738f 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/XPathExpressions.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/constant/XPathExpressions.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.constant; +package au.gov.nehta.vendorlibrary.mhr.clients.common.constant; /** * XPath expression strings used throughout the client libraries. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/CertificateValidationException.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/CertificateValidationException.java similarity index 95% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/CertificateValidationException.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/CertificateValidationException.java index a737e4e..2904330 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/CertificateValidationException.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/CertificateValidationException.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.exception; +package au.gov.nehta.vendorlibrary.mhr.clients.common.exception; /** * Thrown to indicate that certificate validation has failed. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/CertificateVerificationException.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/CertificateVerificationException.java similarity index 95% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/CertificateVerificationException.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/CertificateVerificationException.java index 89673e5..5d5ae2a 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/CertificateVerificationException.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/CertificateVerificationException.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.exception; +package au.gov.nehta.vendorlibrary.mhr.clients.common.exception; /** * Thrown to indicate that certificate verification has failed. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/MTOMException.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/MTOMException.java similarity index 96% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/MTOMException.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/MTOMException.java index 25a2de7..baa0827 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/MTOMException.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/MTOMException.java @@ -12,7 +12,7 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.exception;/* +package au.gov.nehta.vendorlibrary.mhr.clients.common.exception;/* * Copyright 2011 NEHTA * * Licensed under the NEHTA Open Source (Apache) License; you may not use this diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/SignatureValidationException.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/SignatureValidationException.java similarity index 94% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/SignatureValidationException.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/SignatureValidationException.java index b72eea8..1f959a6 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/SignatureValidationException.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/SignatureValidationException.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.exception; +package au.gov.nehta.vendorlibrary.mhr.clients.common.exception; /** * Thrown to indicate that signature validation has failed. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/SignatureVerificationException.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/SignatureVerificationException.java similarity index 95% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/SignatureVerificationException.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/SignatureVerificationException.java index b68c2f8..3c6a514 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/SignatureVerificationException.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/SignatureVerificationException.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.exception; +package au.gov.nehta.vendorlibrary.mhr.clients.common.exception; /** * Thrown to indicate that signature verification has failed. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/ViewUnmarshallException.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/ViewUnmarshallException.java similarity index 79% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/ViewUnmarshallException.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/ViewUnmarshallException.java index 4c877b3..baba049 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/exception/ViewUnmarshallException.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/exception/ViewUnmarshallException.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.exception; +package au.gov.nehta.vendorlibrary.mhr.clients.common.exception; /** diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/ConfigurableMTOMHandler.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/ConfigurableMTOMHandler.java similarity index 91% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/ConfigurableMTOMHandler.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/ConfigurableMTOMHandler.java index 7ee9bf0..69cfde5 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/ConfigurableMTOMHandler.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/ConfigurableMTOMHandler.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.handler; +package au.gov.nehta.vendorlibrary.mhr.clients.common.handler; import java.io.InputStream; import java.nio.charset.StandardCharsets; @@ -19,20 +19,20 @@ import java.util.UUID; import javax.xml.namespace.QName; -import javax.xml.soap.AttachmentPart; -import javax.xml.soap.SOAPBody; -import javax.xml.soap.SOAPBodyElement; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPException; -import javax.xml.ws.handler.MessageContext; -import javax.xml.ws.handler.soap.SOAPMessageContext; +import jakarta.xml.soap.AttachmentPart; +import jakarta.xml.soap.SOAPBody; +import jakarta.xml.soap.SOAPBodyElement; +import jakarta.xml.soap.SOAPEnvelope; +import jakarta.xml.soap.SOAPException; +import jakarta.xml.ws.handler.MessageContext; +import jakarta.xml.ws.handler.soap.SOAPMessageContext; import org.apache.commons.io.IOUtils; import org.w3c.dom.NodeList; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.exception.MTOMException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.HandlerUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces; +import au.gov.nehta.vendorlibrary.mhr.clients.common.exception.MTOMException; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.HandlerUtils; /** * This SOAP handler functions to workaround limitations of SOAPHandlers that breaks MTOM, @@ -119,7 +119,7 @@ public ConfigurableMTOMHandler(String requestType, String requestNamespace, Stri * * @param context the incoming / outgoing soap message context * @return true Always returns true. - * @see javax.xml.ws.handler.Handler#handleMessage(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleMessage(jakarta.xml.ws.handler.MessageContext) */ @Override public final boolean handleMessage(SOAPMessageContext context) { @@ -217,7 +217,7 @@ private void createDocumentAttachmentPart(SOAPMessageContext context, InputStrea * * @param context the incoming / outgoing soap message context * @return true if the handle signature check is successful. - * @see javax.xml.ws.handler.Handler#handleFault(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleFault(jakarta.xml.ws.handler.MessageContext) */ @Override public final boolean handleFault(SOAPMessageContext context) { @@ -248,3 +248,4 @@ public final Set getHeaders() { return null; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/IMTOMHandler.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/IMTOMHandler.java similarity index 81% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/IMTOMHandler.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/IMTOMHandler.java index c7f0447..ba8274a 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/IMTOMHandler.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/IMTOMHandler.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.handler; +package au.gov.nehta.vendorlibrary.mhr.clients.common.handler; -import javax.xml.ws.handler.soap.SOAPHandler; -import javax.xml.ws.handler.soap.SOAPMessageContext; +import jakarta.xml.ws.handler.soap.SOAPHandler; +import jakarta.xml.ws.handler.soap.SOAPMessageContext; /** * A Simple interface to mark MTOM Handler classes @@ -22,3 +22,4 @@ public interface IMTOMHandler extends SOAPHandler { } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/MTOMHandler.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/MTOMHandler.java similarity index 89% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/MTOMHandler.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/MTOMHandler.java index 2526cc1..0c19120 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/MTOMHandler.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/MTOMHandler.java @@ -11,23 +11,23 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.handler; +package au.gov.nehta.vendorlibrary.mhr.clients.common.handler; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.exception.MTOMException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.HandlerUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces; +import au.gov.nehta.vendorlibrary.mhr.clients.common.exception.MTOMException; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.HandlerUtils; import org.apache.commons.io.IOUtils; import org.w3c.dom.NodeList; import javax.xml.namespace.QName; -import javax.xml.soap.AttachmentPart; -import javax.xml.soap.SOAPBody; -import javax.xml.soap.SOAPBodyElement; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPException; -import javax.xml.ws.handler.MessageContext; -import javax.xml.ws.handler.soap.SOAPHandler; -import javax.xml.ws.handler.soap.SOAPMessageContext; +import jakarta.xml.soap.AttachmentPart; +import jakarta.xml.soap.SOAPBody; +import jakarta.xml.soap.SOAPBodyElement; +import jakarta.xml.soap.SOAPEnvelope; +import jakarta.xml.soap.SOAPException; +import jakarta.xml.ws.handler.MessageContext; +import jakarta.xml.ws.handler.soap.SOAPHandler; +import jakarta.xml.ws.handler.soap.SOAPMessageContext; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Set; @@ -80,7 +80,7 @@ public class MTOMHandler implements SOAPHandler { * * @param context the incoming / outgoing soap message context * @return true Always returns true. - * @see javax.xml.ws.handler.Handler#handleMessage(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleMessage(jakarta.xml.ws.handler.MessageContext) */ @Override public final boolean handleMessage(SOAPMessageContext context) { @@ -171,7 +171,7 @@ private void createDocumentAttachmentPart(SOAPMessageContext context, InputStrea * * @param context the incoming / outgoing soap message context * @return true if the handle signature check is successful. - * @see javax.xml.ws.handler.Handler#handleFault(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleFault(jakarta.xml.ws.handler.MessageContext) */ @Override public final boolean handleFault(SOAPMessageContext context) { @@ -202,3 +202,4 @@ public final Set getHeaders() { return null; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/SecurityHandler.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/SecurityHandler.java similarity index 90% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/SecurityHandler.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/SecurityHandler.java index 1acd421..75c9c29 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/handler/SecurityHandler.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/handler/SecurityHandler.java @@ -24,14 +24,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.handler; +package au.gov.nehta.vendorlibrary.mhr.clients.common.handler; import au.gov.nehta.common.utils.ArgumentUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.exception.CertificateVerificationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.exception.SignatureValidationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.exception.SignatureVerificationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.HandlerUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces; +import au.gov.nehta.vendorlibrary.mhr.clients.common.exception.CertificateVerificationException; +import au.gov.nehta.vendorlibrary.mhr.clients.common.exception.SignatureValidationException; +import au.gov.nehta.vendorlibrary.mhr.clients.common.exception.SignatureVerificationException; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.HandlerUtils; import au.gov.nehta.xsp.*; import org.apache.commons.lang3.Validate; import org.w3c.dom.Attr; @@ -41,13 +41,13 @@ import javax.security.auth.x500.X500PrivateCredential; import javax.xml.namespace.QName; -import javax.xml.soap.SOAPBody; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPHeader; -import javax.xml.ws.handler.MessageContext; -import javax.xml.ws.handler.soap.SOAPHandler; -import javax.xml.ws.handler.soap.SOAPMessageContext; +import jakarta.xml.soap.SOAPBody; +import jakarta.xml.soap.SOAPEnvelope; +import jakarta.xml.soap.SOAPException; +import jakarta.xml.soap.SOAPHeader; +import jakarta.xml.ws.handler.MessageContext; +import jakarta.xml.ws.handler.soap.SOAPHandler; +import jakarta.xml.ws.handler.soap.SOAPMessageContext; import java.security.PrivateKey; import java.security.cert.X509Certificate; import java.util.*; @@ -82,9 +82,9 @@ public class SecurityHandler implements SOAPHandler { public static final String DSIG_ELEM = "Signature"; /** - * PCEHRHeader XML element local name. + * MHRHeader XML element local name. */ - public static final String PCEHRH_HEADER_ELEM = "PCEHRHeader"; + public static final String PCEHRH_HEADER_ELEM = "___SOAP_MHRHeader___"; /** * Expected digest value count. @@ -149,7 +149,7 @@ public SecurityHandler(X509Certificate x509Certificate, PrivateKey privateKey, C * * @param context the incoming / outgoing soap message context * @return true Always returns true. - * @see javax.xml.ws.handler.Handler#handleMessage(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleMessage(jakarta.xml.ws.handler.MessageContext) */ public final boolean handleMessage(final SOAPMessageContext context) { @@ -195,7 +195,7 @@ private void checkResponse(final SOAPMessageContext context) { * * @param context the incoming / outgoing soap message context * @return true if the handle signature check is successful. - * @see javax.xml.ws.handler.Handler#handleFault(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleFault(jakarta.xml.ws.handler.MessageContext) */ public final boolean handleFault(final SOAPMessageContext context) { // Verifies the inbound fault signature. @@ -227,7 +227,7 @@ public void close(final MessageContext context) { /** * Signs the SOAP message parts. * - * @param context of type {@link javax.xml.ws.handler.soap.SOAPMessageContext} (Mandatory) + * @param context of type {@link jakarta.xml.ws.handler.soap.SOAPMessageContext} (Mandatory) */ private void signBodyAndSOAPHeaders(final SOAPMessageContext context) { @@ -309,9 +309,9 @@ private void signSoapElements(Element timestampElement, Element headerElement, E /** * Helper method to retrieve the signature's document object model. * - * @param context @see javax.xml.ws.handler.Handler#close(javax.xml.ws.handler.MessageContext). + * @param context @see jakarta.xml.ws.handler.Handler#close(jakarta.xml.ws.handler.MessageContext). * @return Extracted {@link org.w3c.dom.Document} object. - * @throws au.gov.nehta.vendorlibrary.pcehr.clients.common.exception.CertificateVerificationException thrown when signature extraction fails. + * @throws au.gov.nehta.vendorlibrary.mhr.clients.common.exception.CertificateVerificationException thrown when signature extraction fails. */ private Element validateSignature(SOAPMessageContext context) { @@ -362,3 +362,4 @@ private void addSignatureReferenceId(Element bodyElement, Element timestampEleme timestampElement.setAttribute(ID_ATTR, TS_PREFIX + UUID.randomUUID().toString()); } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/Author.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/Author.java similarity index 91% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/Author.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/Author.java index 3443332..683932c 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/Author.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/Author.java @@ -1,6 +1,6 @@ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.Separators; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.Separators; public class Author { public static final String XCN_FORMAT_STRING ="^%s^%s^^^%s^^^&1.2.36.1.2001.1003.0.%s&ISO"; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/CX.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/CX.java similarity index 76% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/CX.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/CX.java index f46c028..5ad058c 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/CX.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/CX.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import au.gov.nehta.common.utils.ArgumentUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.Separators; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.Separators; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} * Encapsulates a HL7 V2 CX identifier. */ public final class CX { @@ -50,10 +50,10 @@ public final class CX { private final String identifierTypeCode; /** - * Private constructor to set {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} instance variables. + * Private constructor to set {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} instance variables. * - * @param builder {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX.Builder} to construct - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} from. + * @param builder {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX.Builder} to construct + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} from. */ private CX(Builder builder) { this.identifier = builder.identifier; @@ -90,11 +90,11 @@ public String getIdentifierTypeCode() { /** - * Parse multiple {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} objects from string. + * Parse multiple {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} objects from string. * * @param value String to be parsed (not null nor blank). - * @param separator {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} list delimiter (not null or blank). - * @return List of {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX}. + * @param separator {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} list delimiter (not null or blank). + * @return List of {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX}. */ public static List parseMultiple(String value, String separator) { ArgumentUtils.checkNotNullNorBlank(value, "value"); @@ -110,7 +110,7 @@ public static List parseMultiple(String value, String separator) { } /** - * Outputs a {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} in the following format: + * Outputs a {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} in the following format: * identifier^^^assigningAuthority^identifierTypeCode * Variables that are not set are denoted by an empty string. * Trailing '^' symbols are trimmed. For example: @@ -132,10 +132,10 @@ public String toString() { } /** - * Parse {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} from string. + * Parse {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} from string. * * @param parseValue String to be parsed (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} */ public static CX parse(String parseValue) { ArgumentUtils.checkNotNull(parseValue, "parseValue"); @@ -165,8 +165,8 @@ public static CX parse(String parseValue) { } /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX.Builder} - * Build class used to construct and validate a {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} object. + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX.Builder} + * Build class used to construct and validate a {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} object. */ public static final class Builder { @@ -186,7 +186,7 @@ public Builder() { * Set identifier. * * @param value Identifier (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX.Builder} */ public Builder identifier(String value) { this.identifier = value; @@ -197,7 +197,7 @@ public Builder identifier(String value) { * Set assigning authority. * * @param value {@link HD} (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX.Builder} */ public Builder assigningAuthority(HD value) { this.assigningAuthority = value; @@ -208,7 +208,7 @@ public Builder assigningAuthority(HD value) { * Set identifier type code. * * @param value Identifier type code (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX.Builder} */ public Builder identifierTypeCode(String value) { this.identifierTypeCode = value; @@ -216,9 +216,9 @@ public Builder identifierTypeCode(String value) { } /** - * Build {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} and validate necessary fields. + * Build {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} and validate necessary fields. * - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX} */ public CX build() { return new CX(this); diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/CodedValue.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/CodedValue.java similarity index 98% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/CodedValue.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/CodedValue.java index 427767c..7043657 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/CodedValue.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/CodedValue.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import org.apache.commons.lang3.builder.CompareToBuilder; import org.apache.commons.lang3.builder.EqualsBuilder; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/ConfidentialityCodes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/ConfidentialityCodes.java similarity index 96% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/ConfidentialityCodes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/ConfidentialityCodes.java index cdd8625..939da94 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/ConfidentialityCodes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/ConfidentialityCodes.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; /** * Confidentiality codes employed in document metadata. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/ConformanceLevels.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/ConformanceLevels.java similarity index 95% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/ConformanceLevels.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/ConformanceLevels.java index fc8abce..be5fee2 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/ConformanceLevels.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/ConformanceLevels.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; /** * CDA document conformance levels. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentConsentCodes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentConsentCodes.java similarity index 92% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentConsentCodes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentConsentCodes.java index 172e98d..7f5b94e 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentConsentCodes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentConsentCodes.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; public class DocumentConsentCodes{ diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentMetadata.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentMetadata.java similarity index 99% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentMetadata.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentMetadata.java index 61e4d46..8511267 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentMetadata.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentMetadata.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import java.math.BigInteger; import java.util.HashSet; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentQueryParams.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentQueryParams.java similarity index 99% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentQueryParams.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentQueryParams.java index b328a0b..74271a8 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentQueryParams.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentQueryParams.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import javax.xml.datatype.DatatypeConstants; import java.util.ArrayList; @@ -22,7 +22,7 @@ /** * Parameters used to query for documents. - * The IHINumber of the PCEHR ($XDSDocumentEntryPatientId) is present in the PCEHRHeader. + * The IHINumber of the PCEHR ($XDSDocumentEntryPatientId) is present in the MHRHeader. */ public final class DocumentQueryParams { // private List authorOrganisations; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentStatus.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentStatus.java similarity index 97% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentStatus.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentStatus.java index 1362c87..1d4be94 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentStatus.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentStatus.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import java.util.EnumSet; import java.util.HashMap; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentTypeCodes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentTypeCodes.java similarity index 96% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentTypeCodes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentTypeCodes.java index 45044c0..a9a05d6 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/DocumentTypeCodes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/DocumentTypeCodes.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; /** * Enumeration of Document Class, Document Type and Content Type Codes. @@ -209,10 +209,10 @@ private String getCode() { } /** - * Retrieves a {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentTypeCodes} based on a supplied concept code. + * Retrieves a {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentTypeCodes} based on a supplied concept code. * * @param conceptCode Concept to search for. - * @return Corresponding {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentTypeCodes} or null. + * @return Corresponding {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentTypeCodes} or null. */ public static DocumentTypeCodes findByConceptCode(String conceptCode) { for (DocumentTypeCodes v : values()) { diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/EvidenceOfIdentityCodes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/EvidenceOfIdentityCodes.java similarity index 95% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/EvidenceOfIdentityCodes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/EvidenceOfIdentityCodes.java index 888f720..f48a49b 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/EvidenceOfIdentityCodes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/EvidenceOfIdentityCodes.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; public enum EvidenceOfIdentityCodes { //Todo:replace with meanignful code names diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/FormatCodes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/FormatCodes.java similarity index 99% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/FormatCodes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/FormatCodes.java index 0732426..38a0286 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/FormatCodes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/FormatCodes.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; /** * Template package identifiers for the various CDA documents and associated diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/HD.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/HD.java similarity index 78% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/HD.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/HD.java index db17705..7c360af 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/HD.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/HD.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import au.gov.nehta.common.utils.ArgumentUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.Separators; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.Separators; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} * Encapsulates an HL7 V2 hierarchic designator HD identifier. */ public final class HD { @@ -47,10 +47,10 @@ public final class HD { private final String identifierType; /** - * Private constructor to set {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} instance variables. + * Private constructor to set {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} instance variables. * - * @param builder {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD.Builder} to construct - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} from. + * @param builder {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD.Builder} to construct + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} from. */ private HD(Builder builder) { namespace = builder.namespace; @@ -86,10 +86,10 @@ public String getIdentifierType() { } /** - * Parse {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} from string. + * Parse {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} from string. * * @param parseValue String to be parsed (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} */ public static HD parse(String parseValue) { ArgumentUtils.checkNotNull(parseValue, "parseValue"); @@ -119,7 +119,7 @@ public static HD parse(String parseValue) { } /** - * Outputs an {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} in the following format: + * Outputs an {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} in the following format: * namespace^identifier^identifierType * Variables that are not set are denoted by an empty string. * Trailing '^' symbols are trimmed. For example: @@ -139,8 +139,8 @@ public String toString() { } /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD.Builder} - * Build class used to construct and validate an {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} object. + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD.Builder} + * Build class used to construct and validate an {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} object. */ public static final class Builder { @@ -161,7 +161,7 @@ public Builder() { * Set the namespace. * * @param value Namespace (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD.Builder} */ public Builder namespace(String value) { this.namespace = value; @@ -172,7 +172,7 @@ public Builder namespace(String value) { * Set the universal identifier. * * @param value Universal identifier (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD.Builder} */ public Builder identifier(String value) { this.identifier = value; @@ -183,7 +183,7 @@ public Builder identifier(String value) { * Set the universal identifier type. * * @param value Universal identifier type (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD.Builder} */ public Builder identifierType(String value) { this.identifierType = value; @@ -193,7 +193,7 @@ public Builder identifierType(String value) { /** * Build HD and validate necessary fields. * - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD} */ public HD build() { return new HD(this); diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/HealthcareFacilityTypeCodes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/HealthcareFacilityTypeCodes.java similarity index 95% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/HealthcareFacilityTypeCodes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/HealthcareFacilityTypeCodes.java index 1c5fd61..8d27ea1 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/HealthcareFacilityTypeCodes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/HealthcareFacilityTypeCodes.java @@ -12,7 +12,7 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; /** * Enumeration of Healthcare Facility Type Codes. @@ -212,10 +212,10 @@ private String getConceptCode() { } /** - * Retrieves a {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes} based on a supplied concept code. + * Retrieves a {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes} based on a supplied concept code. * * @param conceptCode Concept to search for. - * @return Corresponding {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes} or null. + * @return Corresponding {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes} or null. */ public static HealthcareFacilityTypeCodes findByConceptCode(String conceptCode) { for (HealthcareFacilityTypeCodes v : values()) { diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/IVCCorrespondeceChannelCode.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/IVCCorrespondeceChannelCode.java similarity index 93% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/IVCCorrespondeceChannelCode.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/IVCCorrespondeceChannelCode.java index 20797cd..12a8d97 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/IVCCorrespondeceChannelCode.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/IVCCorrespondeceChannelCode.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; public enum IVCCorrespondeceChannelCode { email("email"), diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/IndigenousStatusCode.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/IndigenousStatusCode.java similarity index 93% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/IndigenousStatusCode.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/IndigenousStatusCode.java index 281bbfe..3135460 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/IndigenousStatusCode.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/IndigenousStatusCode.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; public enum IndigenousStatusCode { //TODO: replace with meaningful code names diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/PracticeSettingTypeCodes.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/PracticeSettingTypeCodes.java similarity index 98% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/PracticeSettingTypeCodes.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/PracticeSettingTypeCodes.java index 599acd2..290c4b7 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/PracticeSettingTypeCodes.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/PracticeSettingTypeCodes.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; /** * Enumeration of Practice Setting Type codes. @@ -1018,10 +1018,10 @@ public CodedValue getCodedValue() { } /** - * Retrieves a {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes} based on a supplied concept code. + * Retrieves a {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes} based on a supplied concept code. * * @param conceptCode Concept to search for. - * @return Corresponding {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes} or null. + * @return Corresponding {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes} or null. */ public static PracticeSettingTypeCodes findByConceptCode(String conceptCode) { for (PracticeSettingTypeCodes v : values()) { diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/SubmissionMetadata.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/SubmissionMetadata.java similarity index 97% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/SubmissionMetadata.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/SubmissionMetadata.java index b8f2d83..7ebe03b 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/SubmissionMetadata.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/SubmissionMetadata.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import java.util.Date; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/TemplateServiceRequestorOption.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/TemplateServiceRequestorOption.java similarity index 93% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/TemplateServiceRequestorOption.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/TemplateServiceRequestorOption.java index 4f593b5..cb22fad 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/TemplateServiceRequestorOption.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/TemplateServiceRequestorOption.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; /** * Controls elements to be returned within the template package. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/TypedViewResponse.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/TypedViewResponse.java similarity index 83% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/TypedViewResponse.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/TypedViewResponse.java index f21e3d5..8145ba6 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/TypedViewResponse.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/TypedViewResponse.java @@ -1,14 +1,14 @@ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; import java.io.StringReader; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.exception.ViewUnmarshallException; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.common.exception.ViewUnmarshallException; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetViewResponse; /** * Immutable holder for an unmarshalled view payload and the original {@link GetViewResponse}. @@ -79,3 +79,4 @@ public String getCode() { } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/XCN.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/XCN.java similarity index 81% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/XCN.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/XCN.java index 343c23b..350eec7 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/XCN.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/XCN.java @@ -11,9 +11,9 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.Separators; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.Separators; /** * Encapsulates a partial implementation of an HL7 V2 Extended Person Name XCN identifier. @@ -56,9 +56,9 @@ public final class XCN { private final HD assigningAuthority; /** - * Private constructor to set {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN} instance variables. + * Private constructor to set {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN} instance variables. * - * @param builder Builder to construct {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN} from. + * @param builder Builder to construct {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN} from. */ private XCN(Builder builder) { identifier = builder.identifier; @@ -134,7 +134,7 @@ public HD getAssigningAuthority() { } /** - * Outputs an {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN} in the following format: + * Outputs an {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN} in the following format: * identifier^familyName^givenName^middleInitialOrName^^suffix^pefix^^^assigningAuthority * Variables that are not set are denoted by an empty string. * Trailing '^' symbols are trimmed. For example: @@ -164,8 +164,8 @@ public String toString() { } /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} - * Build class used to construct and validate an {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN} object. + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} + * Build class used to construct and validate an {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN} object. */ public static final class Builder { @@ -193,7 +193,7 @@ public Builder() { * Set the identifier. * * @param value Identifier (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} */ public Builder identifier(String value) { this.identifier = value; @@ -204,7 +204,7 @@ public Builder identifier(String value) { * Set the family name (not null). * * @param value Family name. - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} */ public Builder familyName(String value) { this.familyName = value; @@ -215,7 +215,7 @@ public Builder familyName(String value) { * Set the given name. * * @param value Given name (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} */ public Builder givenName(String value) { this.givenName = value; @@ -226,7 +226,7 @@ public Builder givenName(String value) { * Set the middle initial/name. * * @param value Middle initial/name (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} */ public Builder middleInitialOrName(String value) { this.middleInitialOrName = value; @@ -237,7 +237,7 @@ public Builder middleInitialOrName(String value) { * Set the suffix. * * @param value Suffix (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} */ public Builder suffix(String value) { this.suffix = value; @@ -248,7 +248,7 @@ public Builder suffix(String value) { * Set the prefix. * * @param value Prefix (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} */ public Builder prefix(String value) { this.prefix = value; @@ -259,7 +259,7 @@ public Builder prefix(String value) { * Set the assigning authority. * * @param value Assigning authority (not null). - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN.Builder} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN.Builder} */ public Builder assigningAuthority(HD value) { this.assigningAuthority = value; @@ -267,9 +267,9 @@ public Builder assigningAuthority(HD value) { } /** - * Build {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN} and validate necessary fields. + * Build {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN} and validate necessary fields. * - * @return {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN} + * @return {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN} */ public XCN build() { diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/XON.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/XON.java similarity index 97% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/XON.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/XON.java index 2bab5cc..60b5aed 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/type/XON.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/type/XON.java @@ -11,9 +11,9 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.type; +package au.gov.nehta.vendorlibrary.mhr.clients.common.type; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.Separators; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.Separators; /** * Encapsulates a partial implementation of an HL7 V2 Extended Organisation Name XON identifier. diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/CommonHeaderValidator.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/CommonHeaderValidator.java similarity index 92% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/CommonHeaderValidator.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/CommonHeaderValidator.java index cd2e8ad..5a719ed 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/CommonHeaderValidator.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/CommonHeaderValidator.java @@ -11,9 +11,9 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.apache.commons.lang3.Validate; import java.math.BigInteger; @@ -32,12 +32,12 @@ private CommonHeaderValidator() { } /** - * Validate the contents of the {@link PCEHRHeader}. + * Validate the contents of the {@link MHRHeader}. * - * @param commonHeader A {@link PCEHRHeader}. + * @param commonHeader A {@link MHRHeader}. * @param requireIHINumber Is the IHINumber required? */ - public static void validate(PCEHRHeader commonHeader, boolean requireIHINumber) { + public static void validate(MHRHeader commonHeader, boolean requireIHINumber) { Validate.notNull(commonHeader, "'commonHeader' cannot be null."); diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/DateUtils.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/DateUtils.java similarity index 94% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/DateUtils.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/DateUtils.java index 2e003e1..226fac0 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/DateUtils.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/DateUtils.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.DateParsePatterns; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Timestamp; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.DateParsePatterns; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Timestamp; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import java.time.*; import java.time.format.DateTimeFormatter; import java.util.Date; @@ -55,17 +55,13 @@ private DateUtils() { * @return {@link Timestamp}. */ public static Timestamp generateTimestamp() { - GregorianCalendar gregorianCalendar = new GregorianCalendar(); - gregorianCalendar.setTime(new Date()); - Timestamp timestamp = new Timestamp(); - try { - timestamp.setCreated(DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar)); + timestamp.setCreated(DatatypeFactory.newInstance() + .newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.now()))); } catch (DatatypeConfigurationException e) { throw new IllegalStateException("Unexpected exception has occurred.", e); } - return timestamp; } @@ -217,4 +213,4 @@ private static String outputPrecision(final ZonedDateTime dateTime, final int pr return sb.substring(0, precision); } -} \ No newline at end of file +} diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/FileUtils.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/FileUtils.java similarity index 78% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/FileUtils.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/FileUtils.java index 00b2127..a540036 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/FileUtils.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/FileUtils.java @@ -11,20 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; - -import org.apache.commons.io.IOUtils; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.file.Files; import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; @@ -55,24 +52,7 @@ public static byte[] loadFile(File file) throws IOException { if (!file.exists()) { throw new IllegalArgumentException("The file [" + file + "] does not exist."); } - - FileInputStream is = new FileInputStream(file); - - try { - - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - int nRead; - byte[] data = new byte[BUFFER_SIZE]; - - while ((nRead = is.read(data, 0, data.length)) != -1) { - buffer.write(data, 0, nRead); - } - - buffer.flush(); - return buffer.toByteArray(); - } finally { - is.close(); - } + return Files.readAllBytes(file.toPath()); } /** @@ -82,7 +62,7 @@ public static byte[] loadFile(File file) throws IOException { * @param clazz class to attempt to marshal to. * @param type unmarshalled from the XML file. * @return the Java object unmarshalled from the contents of the XML file. - * @throws javax.xml.bind.JAXBException thrown in the event the file contents cannot be unmarshalled. + * @throws jakarta.xml.bind.JAXBException thrown in the event the file contents cannot be unmarshalled. */ @SuppressWarnings("unchecked") public static T loadXml(File file, Class clazz) throws JAXBException { @@ -130,12 +110,9 @@ public static byte[] getCdaDocument(final byte[] packageContent) { * @throws IOException Thrown if ZIP I/O operations fail. */ private static byte[] readZipEntry(final InputStream zis) throws IOException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[BUFFER_SIZE]; - int count; - - count = zis.read(buffer); + int count = zis.read(buffer); while (count != -1) { baos.write(buffer, 0, count); count = zis.read(buffer); @@ -151,27 +128,17 @@ private static byte[] readZipEntry(final InputStream zis) throws IOException { * @throws IOException Thrown if ZIP I/O operations fail. */ public static Map extractZipEntries(final byte[] packageContent) throws IOException { - - Map result = new HashMap(); - ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(packageContent)); - ZipEntry zipEntry = null; - - try { + Map result = new HashMap<>(); + try (ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(packageContent))) { + ZipEntry zipEntry; while ((zipEntry = zipInputStream.getNextEntry()) != null) { - // Skip directories and only read files if (!zipEntry.isDirectory()) { - result.put( - zipEntry.getName(), - readZipEntry(zipInputStream) - ); + result.put(zipEntry.getName(), readZipEntry(zipInputStream)); } } } catch (IOException e) { throw new IOException("Unable to extract ZIP entries.", e); - } finally { - IOUtils.closeQuietly(zipInputStream); } - return result; } } diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/HandlerUtils.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/HandlerUtils.java similarity index 90% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/HandlerUtils.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/HandlerUtils.java index b1b5ec4..8992e43 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/HandlerUtils.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/HandlerUtils.java @@ -12,17 +12,17 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import org.apache.commons.lang3.Validate; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import javax.xml.soap.SOAPBody; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPException; -import javax.xml.ws.handler.MessageContext; -import javax.xml.ws.handler.soap.SOAPMessageContext; +import jakarta.xml.soap.SOAPBody; +import jakarta.xml.soap.SOAPEnvelope; +import jakarta.xml.soap.SOAPException; +import jakarta.xml.ws.handler.MessageContext; +import jakarta.xml.ws.handler.soap.SOAPMessageContext; public final class HandlerUtils { @@ -93,7 +93,7 @@ public static Boolean isOutgoing(SOAPMessageContext context) { * Extracts a given element's node value. * * @param body the SOAP body to retrieve the element node value from. - * @param namespace the {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces} namespace of the element. + * @param namespace the {@link au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces} namespace of the element. * @param localName the local name of the element. * @return Element's node value. */ @@ -107,3 +107,4 @@ public static String extractElementContent(SOAPBody body, String namespace, Stri } } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/JAXBUtils.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/JAXBUtils.java similarity index 89% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/JAXBUtils.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/JAXBUtils.java index cbb5a84..4e874ff 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/JAXBUtils.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/JAXBUtils.java @@ -11,12 +11,12 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Marshaller; import java.io.OutputStream; /** @@ -58,3 +58,4 @@ public static void marshal(Object obj, OutputStream os) throws JAXBException { marshaller.marshal(obj, os); } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataNamespaceContext.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataNamespaceContext.java similarity index 88% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataNamespaceContext.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataNamespaceContext.java index 098ba58..576796c 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataNamespaceContext.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataNamespaceContext.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces; import javax.xml.XMLConstants; import javax.xml.namespace.NamespaceContext; import java.util.Iterator; /** - * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataNamespaceContext} + * {@link au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataNamespaceContext} * {@link javax.xml.namespace.NamespaceContext} implementation for packaging namespaces. */ public final class MetadataNamespaceContext implements NamespaceContext { diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataUtils.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataUtils.java similarity index 85% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataUtils.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataUtils.java index 9758743..b980bab 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataUtils.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataUtils.java @@ -12,17 +12,15 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.GregorianCalendar; import java.util.UUID; import javax.xml.parsers.DocumentBuilder; @@ -34,18 +32,18 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.Separators; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CX; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HD.Builder; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XCN; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.XON; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.Separators; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CX; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HD.Builder; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.XCN; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.XON; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; /** * Metadata utilities. @@ -98,7 +96,8 @@ public static byte[] calculateSha1Hash(byte[] value) { * @throws SAXException If parsing problems occur. * @throws XPathExpressionException If expression problems occur. */ - public static DocumentMetadata toDocumentMetadata(PCEHRHeader commonHeader, final byte[] cdaDocument) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException { + public static DocumentMetadata toDocumentMetadata(MHRHeader commonHeader, final byte[] cdaDocument) + throws ParserConfigurationException, IOException, SAXException, XPathExpressionException { // Load file into DOM. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); @@ -109,7 +108,8 @@ public static DocumentMetadata toDocumentMetadata(PCEHRHeader commonHeader, fina return toDocumentMetadata(commonHeader, doc); } - public static DocumentMetadata toDocumentMetadata(PCEHRHeader commonHeader, Document rootDocument) throws XPathExpressionException { + public static DocumentMetadata toDocumentMetadata(MHRHeader commonHeader, Document rootDocument) + throws XPathExpressionException { // Instantiate document metadata object. DocumentMetadata documentMetadata = new DocumentMetadata(); @@ -134,7 +134,8 @@ public static DocumentMetadata toDocumentMetadata(PCEHRHeader commonHeader, Docu // Extract values from the supplied CDA root document and populate the // metadata. - documentMetadata.setCreationTime(DateUtils.toUtcDate(XPathUtils.evaluateXPath(XPathExpressions.CREATION_TIME, rootDocument))); + documentMetadata.setCreationTime( + DateUtils.toUtcDate(XPathUtils.evaluateXPath(XPathExpressions.CREATION_TIME, rootDocument))); String languageCode = XPathUtils.evaluateXPath(XPathExpressions.LANGUAGE_CODE, rootDocument); if (languageCode == null || languageCode.length() == 0) { @@ -165,14 +166,14 @@ public static DocumentMetadata toDocumentMetadata(PCEHRHeader commonHeader, Docu } } - // Extract organisation identifier. XON.Builder xonBuilder = new XON.Builder(); xonBuilder.organisationName(orgName); xonBuilder.organisationIdentifier(orgId); documentMetadata.setAuthorInstitution(xonBuilder.build()); - documentMetadata.setAuthorSpecialty(XPathUtils.evaluateXPath(XPathExpressions.AUTHOR_SPECIALTY_NAME, rootDocument)); + documentMetadata + .setAuthorSpecialty(XPathUtils.evaluateXPath(XPathExpressions.AUTHOR_SPECIALTY_NAME, rootDocument)); // Extract author person. XCN.Builder xcnBuilder = new XCN.Builder(); @@ -197,7 +198,8 @@ public static DocumentMetadata toDocumentMetadata(PCEHRHeader commonHeader, Docu hdBuilder.identifier(pai_d).identifierType(XDSConstants.ISO_IDENTIFIER_TYPE); } else { String root = XPathUtils.evaluateXPath(XPathExpressions.AUTHOR_IDENTITY_AUTHORITY_ROOT, rootDocument); - String ext = XPathUtils.evaluateXPath(XPathExpressions.AUTHOR_IDENTITY_AUTHORITY_EXTENSION, rootDocument); + String ext = XPathUtils.evaluateXPath(XPathExpressions.AUTHOR_IDENTITY_AUTHORITY_EXTENSION, + rootDocument); hdBuilder.namespace(root + "^").identifier(ext).identifierType(XDSConstants.ISO_IDENTIFIER_TYPE); } @@ -211,18 +213,18 @@ public static DocumentMetadata toDocumentMetadata(PCEHRHeader commonHeader, Docu documentMetadata.setDocumentClass(getDocumentClass(type)); documentMetadata.setDocumentType(getDocumentType(type)); - - //never set the title - //documentMetadata.setTitle( XPathUtils.evaluateXPath( XPathExpressions.TITLE, rootDocument ) ); + // never set the title + // documentMetadata.setTitle( XPathUtils.evaluateXPath( XPathExpressions.TITLE, + // rootDocument ) ); // Return populated document metadata object. return documentMetadata; } - // Set service start and stop time. - private static void setStartStopTime(Document rootDocument, DocumentMetadata documentMetadata) throws XPathExpressionException { - //get the document type code + private static void setStartStopTime(Document rootDocument, DocumentMetadata documentMetadata) + throws XPathExpressionException { + // get the document type code String documentTypeCode = XPathUtils.evaluateXPath(XPathExpressions.DOCUMENT_TYPE_CODE, rootDocument); // if Prescription Start Time @@ -237,7 +239,6 @@ private static void setStartStopTime(Document rootDocument, DocumentMetadata doc addGenericStopTime(documentMetadata, rootDocument); } - // else if it's a Dispense Start Time } else if (DISPENSE_DOCUMENT_CODE.equals(documentTypeCode)) { @@ -251,8 +252,7 @@ private static void setStartStopTime(Document rootDocument, DocumentMetadata doc addGenericStopTime(documentMetadata, rootDocument); } - - //else if pathology report + // else if pathology report } else if (PATHOLOGY_DOCUMENT_CODE.equals(documentTypeCode)) { String collectionTime = XPathUtils.evaluateXPath(XPathExpressions.PATHOLOGY_COLLECTION_TIME, rootDocument); if (isNotEmpty(collectionTime)) { @@ -264,7 +264,6 @@ private static void setStartStopTime(Document rootDocument, DocumentMetadata doc addGenericStopTime(documentMetadata, rootDocument); } - } else if (DIAGNOSTIC_IMAGE.equals(documentTypeCode)) { String imageTime = XPathUtils.evaluateXPath(XPathExpressions.DIAGNOSTIC_IMAGE_TIME, rootDocument); if (isNotEmpty(imageTime)) { @@ -283,7 +282,8 @@ private static void setStartStopTime(Document rootDocument, DocumentMetadata doc } } - private static void addGenericStopTime(DocumentMetadata documentMetadata, Document rootDocument) throws XPathExpressionException { + private static void addGenericStopTime(DocumentMetadata documentMetadata, Document rootDocument) + throws XPathExpressionException { String cdaStopTime = XPathUtils.evaluateXPath(XPathExpressions.SERVICE_STOP_TIME, rootDocument); String cdaFixedTime = XPathUtils.evaluateXPath(XPathExpressions.SERVICE_FIXED_TIME, rootDocument); @@ -296,11 +296,13 @@ private static void addGenericStopTime(DocumentMetadata documentMetadata, Docume } } - private static void addGenericStartTime(Document rootDocument, DocumentMetadata documentMetadata) throws XPathExpressionException { + private static void addGenericStartTime(Document rootDocument, DocumentMetadata documentMetadata) + throws XPathExpressionException { documentMetadata.setServiceStartTime(getGenericStartTime(rootDocument, documentMetadata)); } - private static String getGenericStartTime(Document rootDocument, DocumentMetadata documentMetadata) throws XPathExpressionException { + private static String getGenericStartTime(Document rootDocument, DocumentMetadata documentMetadata) + throws XPathExpressionException { String cdaStartTime = XPathUtils.evaluateXPath(XPathExpressions.SERVICE_START_TIME, rootDocument); String cdaFixedTime = XPathUtils.evaluateXPath(XPathExpressions.SERVICE_FIXED_TIME, rootDocument); @@ -313,7 +315,6 @@ private static String getGenericStartTime(Document rootDocument, DocumentMetadat } } - private static CX getPatientId(Document rootDocument) throws XPathExpressionException { // Retrieve and split CDA value. CX.Builder builder = new CX.Builder(); @@ -324,7 +325,8 @@ private static CX getPatientId(Document rootDocument) throws XPathExpressionExce // CX components. String[] components = StringUtils.split(cdaId, Separators.OID); builder.identifier(components[components.length - 1]); - builder.assigningAuthority(new HD.Builder().identifier(StringUtils.substringBeforeLast(cdaId, Separators.OID)).identifierType(XDSConstants.ISO_IDENTIFIER_TYPE).build()); + builder.assigningAuthority(new HD.Builder().identifier(StringUtils.substringBeforeLast(cdaId, Separators.OID)) + .identifierType(XDSConstants.ISO_IDENTIFIER_TYPE).build()); // Build and return CX. return builder.build(); @@ -346,7 +348,6 @@ private static DocumentTypeCodes getDocumentTypeCode(Document rootDocument) thro } public static Date parseDate(String str) { - String formatStr; if (str.length() == YMD_DATE_FORMAT) { formatStr = "yyyyMMdd"; @@ -362,21 +363,13 @@ public static Date parseDate(String str) { formatStr = ""; } - DateFormat df = new SimpleDateFormat(formatStr); try { - - Date tmp = df.parse(str); - - GregorianCalendar gregorianCalendar = new GregorianCalendar(); - gregorianCalendar.setTime(tmp); - - return df.parse(str); + return new SimpleDateFormat(formatStr).parse(str); } catch (ParseException e) { throw new IllegalArgumentException("Value [" + str + "] did not contain a valid date/time.", e); } } - private static boolean isEmpty(String string) { return string == null || "".equals(string); } diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataValidator.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataValidator.java similarity index 93% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataValidator.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataValidator.java index b027f8e..325e06b 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MetadataValidator.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MetadataValidator.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.SubmissionMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.SubmissionMetadata; import org.apache.commons.lang3.Validate; /** @@ -29,9 +29,9 @@ private MetadataValidator() { } /** - * Validate the contents of the {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata}. + * Validate the contents of the {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata}. * - * @param documentMetadata A {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata}. + * @param documentMetadata A {@link au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata}. */ public static void validate(DocumentMetadata documentMetadata) { Validate.notNull(documentMetadata, "'documentMetadata' must be specified."); diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MinimalCertificateVerifier.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MinimalCertificateVerifier.java similarity index 95% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MinimalCertificateVerifier.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MinimalCertificateVerifier.java index a90bad1..58651e9 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/MinimalCertificateVerifier.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/MinimalCertificateVerifier.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import au.gov.nehta.xsp.CertificateValidationException; import au.gov.nehta.xsp.CertificateValidator; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/OIDUtil.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/OIDUtil.java similarity index 98% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/OIDUtil.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/OIDUtil.java index 1d00f9a..ebbcc1b 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/OIDUtil.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/OIDUtil.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import org.apache.commons.lang3.Validate; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/SystemOutHandler.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/SystemOutHandler.java similarity index 97% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/SystemOutHandler.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/SystemOutHandler.java index 2f8a747..e6b3776 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/SystemOutHandler.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/SystemOutHandler.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. @@ -47,7 +47,7 @@ import com.sun.xml.ws.api.streaming.XMLStreamWriterFactory; import javax.xml.namespace.QName; -import javax.xml.ws.handler.MessageContext; +import jakarta.xml.ws.handler.MessageContext; import javax.xml.stream.XMLStreamWriter; import javax.xml.stream.XMLStreamException; @@ -133,3 +133,4 @@ private XMLStreamWriter createIndenter(XMLStreamWriter writer) { return writer; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XDSFactory.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XDSFactory.java similarity index 97% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XDSFactory.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XDSFactory.java index 4049c32..4bf839c 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XDSFactory.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XDSFactory.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; import oasis.names.tc.ebxml_regrep.xsd.rim._3.ClassificationType; import oasis.names.tc.ebxml_regrep.xsd.rim._3.ExternalIdentifierType; import oasis.names.tc.ebxml_regrep.xsd.rim._3.InternationalStringType; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XDSMapper.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XDSMapper.java similarity index 97% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XDSMapper.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XDSMapper.java index c60ce75..93f25e1 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XDSMapper.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XDSMapper.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import java.util.ArrayList; import java.util.Collections; @@ -20,8 +20,8 @@ import java.util.List; import java.util.Set; -import javax.xml.bind.JAXBElement; -import javax.xml.ws.Holder; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.ws.Holder; import oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest; @@ -44,14 +44,14 @@ import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.time.FastDateFormat; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.Author; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.SubmissionMetadata; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.Author; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.SubmissionMetadata; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; /** * A utility class to map IHE XDS.b classes to local classes. @@ -80,7 +80,7 @@ private XDSMapper() { * replaces (may be null for a new document). * @return An XDS {@link SubmitObjectsRequest}. */ - public static SubmitObjectsRequest toSubmitObjectsRequest(PCEHRHeader commonHeader, + public static SubmitObjectsRequest toSubmitObjectsRequest(MHRHeader commonHeader, SubmissionMetadata submissionMetadata, DocumentMetadata documentMetadata, String replacesDocumentId) { @@ -151,7 +151,7 @@ public static SubmitObjectsRequest toSubmitObjectsRequest(PCEHRHeader commonHead * @return an XDS {@link ExtrinsicObjectType} containing an XDSDocumentEntry. */ public static ExtrinsicObjectType toXDSDocumentEntry( - PCEHRHeader commonHeader, + MHRHeader commonHeader, DocumentMetadata documentMetadata, Holder idClCounter, Holder idEiCounter @@ -484,7 +484,7 @@ public static RegistryPackageType toXDSSubmissionSet( * @param queryParams additional query parameters. * @return The {@link AdhocQueryRequest} containing the {@link DocumentQueryParams}. */ - public static AdhocQueryRequest toAdhocQueryRequest(PCEHRHeader commonHeader, + public static AdhocQueryRequest toAdhocQueryRequest(MHRHeader commonHeader, String queryId, DocumentQueryParams queryParams) { Validate.notNull(commonHeader, "'commonHeader' must be specified."); @@ -631,7 +631,7 @@ public static AdhocQueryRequest toAdhocQueryRequest(PCEHRHeader commonHeader, * @param queryRequest An XDS {@link DocumentQueryParams}. * @return The {@link DocumentQueryParams} extracted from the {@link AdhocQueryRequest}. */ - public static DocumentQueryParams getDocumentQueryParams(PCEHRHeader commonHeader, AdhocQueryRequest queryRequest) { + public static DocumentQueryParams getDocumentQueryParams(MHRHeader commonHeader, AdhocQueryRequest queryRequest) { Validate.notNull(commonHeader, "'commonHeader' must be specified."); Validate.notNull(queryRequest, "'queryRequest' must be specified."); Validate.notNull(queryRequest.getAdhocQuery(), "'queryRequest.adhocQuery' must be specified."); @@ -650,7 +650,7 @@ public static DocumentQueryParams getDocumentQueryParams(PCEHRHeader commonHeade if (!StringUtils.equals(commonHeader.getIhiNumber(), patientId)) { throw new IllegalArgumentException( String.format( - "The PCEHRHeader.IHINumber [%s] does not equal the %s parameter in the AdhocQuery [%s].", + "The MHRHeader.IHINumber [%s] does not equal the %s parameter in the AdhocQuery [%s].", commonHeader.getIhiNumber(), XDSConstants.QUERY_PARAM_DOCUMENT_ENTRY_PATIENT_ID, patientId @@ -927,3 +927,4 @@ private static String toDateTimeString(Date date) { return DATETIME_FORMATTER.format(date); } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XPathUtils.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XPathUtils.java similarity index 96% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XPathUtils.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XPathUtils.java index 0197115..15177d9 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XPathUtils.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XPathUtils.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import org.w3c.dom.Document; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XmlUtil.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XmlUtil.java similarity index 93% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XmlUtil.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XmlUtil.java index 2930e4d..2e34fe1 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XmlUtil.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XmlUtil.java @@ -11,13 +11,13 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import java.io.ByteArrayOutputStream; import java.util.logging.Level; import java.util.logging.Logger; -import javax.xml.soap.SOAPMessage; +import jakarta.xml.soap.SOAPMessage; /** * A helper class to obtain easy-to-read XML from SOAPMessage objects. @@ -48,4 +48,4 @@ public static String serialiseSoapXml(final SOAPMessage message) { return soap; } -} \ No newline at end of file +} diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XmlUtils.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XmlUtils.java similarity index 93% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XmlUtils.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XmlUtils.java index 5205a56..1799302 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/XmlUtils.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/common/util/XmlUtils.java @@ -11,14 +11,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; +package au.gov.nehta.vendorlibrary.mhr.clients.common.util; import org.w3c.dom.Node; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPMessage; -import javax.xml.soap.SOAPPart; +import jakarta.xml.soap.SOAPEnvelope; +import jakarta.xml.soap.SOAPException; +import jakarta.xml.soap.SOAPMessage; +import jakarta.xml.soap.SOAPPart; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -94,4 +94,4 @@ private static Transformer getTransformer() throws TransformerConfigurationExcep return transformer; } -} \ No newline at end of file +} diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/GetDocumentClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/GetDocumentClient.java similarity index 88% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/GetDocumentClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/GetDocumentClient.java index ab232e5..8adadcc 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/GetDocumentClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/GetDocumentClient.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.clients.documentexchange; import ihe.iti.xds_b._2007.DocumentRepositoryPortType; import ihe.iti.xds_b._2007.DocumentRepositoryService; @@ -23,16 +23,16 @@ import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; /** * A JAX-WS client to the PCEHR 'Get Document' web service. @@ -107,7 +107,7 @@ public GetDocumentClient( * @param docRequest A request containing the unique document identifier. * @return The requested document. */ - public RetrieveDocumentSetResponse retrieveDocument(PCEHRHeader commonHeader, DocumentRequest docRequest) { + public RetrieveDocumentSetResponse retrieveDocument(MHRHeader commonHeader, DocumentRequest docRequest) { Validate.notNull(commonHeader, "'commonHeader' must be specified."); Validate.notNull(docRequest, "'docRequest' must be specified."); @@ -128,3 +128,4 @@ public RetrieveDocumentSetResponse retrieveDocument(PCEHRHeader commonHeader, Do ); } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/RemoveDocumentClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/RemoveDocumentClient.java similarity index 81% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/RemoveDocumentClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/RemoveDocumentClient.java index 06cf7ab..d695faf 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/RemoveDocumentClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/RemoveDocumentClient.java @@ -11,28 +11,28 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.clients.documentexchange; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.RemoveDocumentPortType; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.RemoveDocumentService; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument.DocumentRemovalReason; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.RemoveDocumentPortType; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.RemoveDocumentService; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument.DocumentRemovalReason; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; /** * A JAX-WS client to the PCEHR 'Remove Document' web service. @@ -106,7 +106,7 @@ public RemoveDocumentClient( * @throws StandardErrorMsg On operation failure. */ public RemoveDocumentResponse removeDocument( - PCEHRHeader commonHeader, + MHRHeader commonHeader, String documentId, DocumentRemovalReason removalReason ) throws StandardErrorMsg { @@ -134,3 +134,4 @@ public RemoveDocumentResponse removeDocument( return removeDocumentResponseHolder.value; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/UploadDocumentClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/UploadDocumentClient.java similarity index 89% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/UploadDocumentClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/UploadDocumentClient.java index c82710f..9565c17 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/UploadDocumentClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/UploadDocumentClient.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.clients.documentexchange; import ihe.iti.xds_b._2007.DocumentRepositoryPortType; import ihe.iti.xds_b._2007.DocumentRepositoryService; @@ -25,7 +25,7 @@ import javax.net.ssl.SSLSocketFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPathExpressionException; import oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest; @@ -34,21 +34,21 @@ import org.apache.commons.lang3.Validate; import org.xml.sax.SAXException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.handler.ConfigurableMTOMHandler; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.ConfidentialityCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.SubmissionMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.XDSMapper; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces; +import au.gov.nehta.vendorlibrary.mhr.clients.common.handler.ConfigurableMTOMHandler; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.ConfidentialityCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.SubmissionMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.XDSMapper; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; /** * A JAX-WS client to the PCEHR 'Upload Document' web service. @@ -133,7 +133,7 @@ public UploadDocumentClient( * @throws ParserConfigurationException If config error occurs. */ public RegistryResponseType uploadDocument( - final PCEHRHeader commonHeader, + final MHRHeader commonHeader, final byte[] packageContent, final CodedValue healthcareFacilityType, final CodedValue practiceSettingTypeCode, @@ -165,7 +165,7 @@ public RegistryResponseType uploadDocument( * @throws ParserConfigurationException If config error occurs. */ public RegistryResponseType uploadDocument( - final PCEHRHeader commonHeader, + final MHRHeader commonHeader, final byte[] packageContent, final String replacementId, final CodedValue healthcareFacilityType, @@ -201,7 +201,7 @@ public RegistryResponseType uploadDocument( * @throws ParserConfigurationException If config error occurs. */ public RegistryResponseType uploadDocument( - final PCEHRHeader commonHeader, + final MHRHeader commonHeader, final byte[] packageContent, final String replacementId, final String repositoryUniqueId, @@ -255,3 +255,4 @@ public RegistryResponseType uploadDocument( ); } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/UploadDocumentMetadataClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/UploadDocumentMetadataClient.java similarity index 88% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/UploadDocumentMetadataClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/UploadDocumentMetadataClient.java index bdaf0bd..d450988 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/documentexchange/UploadDocumentMetadataClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/documentexchange/UploadDocumentMetadataClient.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.clients.documentexchange; import ihe.iti.xds_b._2007.DocumentRegistryPortType; import ihe.iti.xds_b._2007.DocumentRegistryService; @@ -24,7 +24,7 @@ import javax.net.ssl.SSLSocketFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPathExpressionException; import oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest; @@ -33,18 +33,18 @@ import org.apache.commons.lang3.Validate; import org.xml.sax.SAXException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.ConfidentialityCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.SubmissionMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.XDSMapper; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.ConfidentialityCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.SubmissionMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.XDSMapper; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; /** * A JAX-WS client to the PCEHR 'Upload Document Metadata' web service. @@ -134,7 +134,7 @@ public UploadDocumentMetadataClient( */ public RegistryResponseType uploadDocumentMetadata( - final PCEHRHeader commonHeader, + final MHRHeader commonHeader, final byte[] packageContent, final String repositoryUniqueId, final CodedValue healthcareFacilityTypeCode, @@ -179,3 +179,4 @@ public RegistryResponseType uploadDocumentMetadata( ); } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/recordaccess/DoesPCEHRExistClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/recordaccess/DoesMHRExistClient.java similarity index 72% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/recordaccess/DoesPCEHRExistClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/recordaccess/DoesMHRExistClient.java index 47f651a..b461470 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/recordaccess/DoesPCEHRExistClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/recordaccess/DoesMHRExistClient.java @@ -11,31 +11,31 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.clients.recordaccess; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.PCEHRProfilePortType; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.PCEHRProfileService; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.MHRProfilePortType; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.MHRProfileService; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; /** * A JAX-WS client to the PCEHR 'Does PCEHR Exist' web service. */ -public class DoesPCEHRExistClient extends Client { +public class DoesMHRExistClient extends Client { /** * Constructor - no certificate verification performed. @@ -46,7 +46,7 @@ public class DoesPCEHRExistClient extends Client { * @param endpointAddress the endpoint address of the web service (mandatory). * @param setLoggingEnabled set to true to enable logging (mandatory). */ - public DoesPCEHRExistClient( + public DoesMHRExistClient( final SSLSocketFactory sslSocketFactory, final X509Certificate x509Certificate, final PrivateKey privateKey, @@ -54,8 +54,8 @@ public DoesPCEHRExistClient( final boolean setLoggingEnabled ) { super( - PCEHRProfileService.class, - PCEHRProfilePortType.class, + MHRProfileService.class, + MHRProfilePortType.class, sslSocketFactory, x509Certificate, privateKey, @@ -74,7 +74,7 @@ public DoesPCEHRExistClient( * @param endpointAddress the endpoint address of the web service (mandatory). * @param setLoggingEnabled set to true to enable logging (mandatory). */ - public DoesPCEHRExistClient( + public DoesMHRExistClient( final SSLSocketFactory sslSocketFactory, final X509Certificate x509Certificate, final CertificateValidator certificateVerifier, @@ -83,8 +83,8 @@ public DoesPCEHRExistClient( final boolean setLoggingEnabled ) { super( - PCEHRProfileService.class, - PCEHRProfilePortType.class, + MHRProfileService.class, + MHRProfilePortType.class, sslSocketFactory, x509Certificate, certificateVerifier, @@ -97,17 +97,17 @@ public DoesPCEHRExistClient( /** * Invokes the web service operation which confirms whether or not an individual has a shared, accessible electronic health record. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). - * @return response (type {@link DoesPCEHRExistResponse}) containing check results. + * @param commonHeader populated {@link MHRHeader} request object (Mandatory). + * @return response (type {@link DoesMHRExistResponse}) containing check results. * @throws StandardErrorMsg thrown in the event of an operation invocation error. */ - public final DoesPCEHRExistResponse doesPCEHRExist(final PCEHRHeader commonHeader) throws StandardErrorMsg { + public final DoesMHRExistResponse doesPCEHRExist(final MHRHeader commonHeader) throws StandardErrorMsg { Validate.notNull(commonHeader, "'commonHeader' must be specified."); CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. // Response holder variables. - Holder responseHolder = new Holder<>(); + Holder responseHolder = new Holder<>(); Holder signatureHolder = null; // Attempt to call the doesPCEHRExist operation, storing response message values in the supplied holders. @@ -122,3 +122,4 @@ public final DoesPCEHRExistResponse doesPCEHRExist(final PCEHRHeader commonHeade return responseHolder.value; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/recordaccess/GainPCEHRAccessClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/recordaccess/GainMHRAccessClient.java similarity index 69% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/recordaccess/GainPCEHRAccessClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/recordaccess/GainMHRAccessClient.java index c8d88a9..2f0f344 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/recordaccess/GainPCEHRAccessClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/recordaccess/GainMHRAccessClient.java @@ -11,33 +11,33 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.clients.recordaccess; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.PCEHRProfilePortType; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.PCEHRProfileService; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.ResponseStatusType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccessResponse; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.MHRProfilePortType; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.MHRProfileService; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.ResponseStatusType; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccessResponse; /** * A JAX-WS client to the PCEHR 'Gain PCEHR Access' web service. */ -public class GainPCEHRAccessClient extends Client { +public class GainMHRAccessClient extends Client { /** * Constructor - no certificate verification performed. @@ -48,7 +48,7 @@ public class GainPCEHRAccessClient extends Client { * @param endpointAddress the endpoint address of the web service (mandatory). * @param setLoggingEnabled set to true to enable logging (mandatory). */ - public GainPCEHRAccessClient( + public GainMHRAccessClient( final SSLSocketFactory sslSocketFactory, final X509Certificate x509Certificate, final PrivateKey privateKey, @@ -56,8 +56,8 @@ public GainPCEHRAccessClient( final boolean setLoggingEnabled ) { super( - PCEHRProfileService.class, - PCEHRProfilePortType.class, + MHRProfileService.class, + MHRProfilePortType.class, sslSocketFactory, x509Certificate, privateKey, @@ -76,7 +76,7 @@ public GainPCEHRAccessClient( * @param endpointAddress the endpoint address of the web service (mandatory). * @param setLoggingEnabled set to true to enable logging (mandatory). */ - public GainPCEHRAccessClient( + public GainMHRAccessClient( final SSLSocketFactory sslSocketFactory, final X509Certificate x509Certificate, final CertificateValidator certificateVerifier, @@ -85,8 +85,8 @@ public GainPCEHRAccessClient( final boolean setLoggingEnabled ) { super( - PCEHRProfileService.class, - PCEHRProfilePortType.class, + MHRProfileService.class, + MHRProfilePortType.class, sslSocketFactory, x509Certificate, certificateVerifier, @@ -99,14 +99,14 @@ public GainPCEHRAccessClient( /** * Invokes the web service operation which confirms whether or not an individual has a shared, accessible electronic health record. * - * @param pcehrRecord populated {@code GainPCEHRAccess.PCEHRRecord} object encapsulating individual and authorisation detail (Mandatory). - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). - * @return response (type {@link GainPCEHRAccessResponse}) containing check results. + * @param pcehrRecord populated {@code GainMHRAccess.MHRRecord} object encapsulating individual and authorisation detail (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object (Mandatory). + * @return response (type {@link GainMHRAccessResponse}) containing check results. * @throws StandardErrorMsg thrown in the event of an operation invocation error. */ - public final GainPCEHRAccessResponse gainPCEHRAccess( - final GainPCEHRAccess.PCEHRRecord pcehrRecord, - final PCEHRHeader commonHeader + public final GainMHRAccessResponse gainPCEHRAccess( + final GainMHRAccess.MHRRecord pcehrRecord, + final MHRHeader commonHeader ) throws StandardErrorMsg { Validate.notNull(commonHeader, "'commonHeader' must be specified."); @@ -114,17 +114,17 @@ public final GainPCEHRAccessResponse gainPCEHRAccess( CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. if (pcehrRecord.getAuthorisationDetails() != null) { - if (pcehrRecord.getAuthorisationDetails().getAccessType() == GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.ACCESS_CODE) { + if (pcehrRecord.getAuthorisationDetails().getAccessType() == GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.ACCESS_CODE) { Validate.notEmpty(pcehrRecord.getAuthorisationDetails().getAccessCode(), "'pcehrRecord.authorisationDetails.accessCode' must be specified."); } } // Response object to be populated. - GainPCEHRAccessResponse response = new GainPCEHRAccessResponse(); + GainMHRAccessResponse response = new GainMHRAccessResponse(); // Holder variables. Holder responseHolder = new Holder<>(); - Holder individualHolder = new Holder<>(); + Holder individualHolder = new Holder<>(); Holder signatureHolder = null; // Attempt to call the gainPCEHRAccess operation, storing response message values in the supplied holders. @@ -144,3 +144,4 @@ public final GainPCEHRAccessResponse gainPCEHRAccess( return response; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/registration/RegisterPCEHRClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/registration/RegisterMHRClient.java similarity index 70% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/registration/RegisterPCEHRClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/registration/RegisterMHRClient.java index 3db154b..caed96f 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/registration/RegisterPCEHRClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/registration/RegisterMHRClient.java @@ -11,34 +11,34 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.registration; +package au.gov.nehta.vendorlibrary.mhr.clients.registration; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.handler.ConfigurableMTOMHandler; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces; +import au.gov.nehta.vendorlibrary.mhr.clients.common.handler.ConfigurableMTOMHandler; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.svc.registerpcehr._2.RegisterPCEHRPortType; -import au.net.electronichealth.ns.pcehr.svc.registerpcehr._2.RegisterPCEHRService; -import au.net.electronichealth.ns.pcehr.svc.registerpcehr._2.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHRResponse; +import au.net.electronichealth.ns.mhr.svc.registermhr._2.RegisterMHRPortType; +import au.net.electronichealth.ns.mhr.svc.registermhr._2.RegisterMHRService; +import au.net.electronichealth.ns.mhr.svc.registermhr._2.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHRResponse; /** * A JAX-WS client to the PCEHR 'Register PCEHR' web service. */ -public class RegisterPCEHRClient extends Client { +public class RegisterMHRClient extends Client { /** * Constructor - no certificate verification performed. * @@ -48,7 +48,7 @@ public class RegisterPCEHRClient extends Client { * @param endpointAddress the endpoint address of the web service (mandatory). * @param setLoggingEnabled set to true to enable logging (mandatory). */ - public RegisterPCEHRClient( + public RegisterMHRClient( final SSLSocketFactory sslSocketFactory, final X509Certificate x509Certificate, final PrivateKey privateKey, @@ -56,8 +56,8 @@ public RegisterPCEHRClient( final boolean setLoggingEnabled ) { super( - RegisterPCEHRService.class, - RegisterPCEHRPortType.class, + RegisterMHRService.class, + RegisterMHRPortType.class, sslSocketFactory, x509Certificate, privateKey, @@ -78,7 +78,7 @@ public RegisterPCEHRClient( * @param endpointAddress the endpoint address of the web service (mandatory). * @param setLoggingEnabled set to true to enable logging (mandatory). */ - public RegisterPCEHRClient( + public RegisterMHRClient( final SSLSocketFactory sslSocketFactory, final X509Certificate x509Certificate, final CertificateValidator certificateVerifier, @@ -86,8 +86,8 @@ public RegisterPCEHRClient( final String endpointAddress, final boolean setLoggingEnabled ) { - super(RegisterPCEHRService.class, - RegisterPCEHRPortType.class, + super(RegisterMHRService.class, + RegisterMHRPortType.class, sslSocketFactory, x509Certificate, certificateVerifier, @@ -102,22 +102,22 @@ public RegisterPCEHRClient( /** * Invokes the web service operation for registering a PCEHR for an individual or dependent child. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object (Mandatory). * @param registrationDetails registerPCEHR request payload. - * @return response (type {@link RegisterPCEHRResponse}) + * @return response (type {@link RegisterMHRResponse}) * @throws StandardErrorMsg If an error occurs. */ - public final RegisterPCEHRResponse registerPCEHR(final PCEHRHeader commonHeader, final RegisterPCEHR registrationDetails) throws StandardErrorMsg { + public final RegisterMHRResponse registerPCEHR(final MHRHeader commonHeader, final RegisterMHR registrationDetails) throws StandardErrorMsg { Validate.notNull(commonHeader, "'commonHeader' must be specified."); Validate.notNull(registrationDetails, "'registrationDetails' must be specified."); CommonHeaderValidator.validate(commonHeader, false); // IHINumber is required. // Response holder variables. - Holder responseHolder = new Holder<>(); + Holder responseHolder = new Holder<>(); Holder signatureHolder = null; // Attempt to call the registerPCEHR operation storing response message values in the supplied holders. - getPort().registerPCEHR( + getPort().registerMHR( registrationDetails, responseHolder, DateUtils.generateTimestamp(), @@ -128,3 +128,4 @@ public final RegisterPCEHRResponse registerPCEHR(final PCEHRHeader commonHeader, return responseHolder.value; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/template/GetTemplateClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/template/GetTemplateClient.java similarity index 89% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/template/GetTemplateClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/template/GetTemplateClient.java index e855e88..21efa92 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/template/GetTemplateClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/template/GetTemplateClient.java @@ -11,23 +11,23 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.template; +package au.gov.nehta.vendorlibrary.mhr.clients.template; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TemplateServiceRequestorOption; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TemplateServiceRequestorOption; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; import au.net.electronichealth.ns.tplt.svc.gettemplate._1.GetTemplatePortType; import au.net.electronichealth.ns.tplt.svc.gettemplate._1.GetTemplateService; import au.net.electronichealth.ns.tplt.svc.gettemplate._1.StandardErrorMsg; @@ -106,7 +106,7 @@ public GetTemplateClient( * @throws StandardErrorMsg On operation failure. */ public GetTemplateResponse getTemplate( - PCEHRHeader commonHeader, + MHRHeader commonHeader, String templateId, TemplateServiceRequestorOption requestorOption ) throws StandardErrorMsg { @@ -120,7 +120,7 @@ public GetTemplateResponse getTemplate( } public GetTemplateResponse getTemplate( - PCEHRHeader commonHeader, + MHRHeader commonHeader, String templateId, String requestorOption ) throws StandardErrorMsg { @@ -150,3 +150,4 @@ public GetTemplateResponse getTemplate( return responseHolder.value; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/template/SearchTemplateClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/template/SearchTemplateClient.java similarity index 91% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/template/SearchTemplateClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/template/SearchTemplateClient.java index 035bd06..09d38b8 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/template/SearchTemplateClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/template/SearchTemplateClient.java @@ -11,22 +11,22 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.template; +package au.gov.nehta.vendorlibrary.mhr.clients.template; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; import au.net.electronichealth.ns.tplt.svc.searchtemplate._1.SearchTemplatePortType; import au.net.electronichealth.ns.tplt.svc.searchtemplate._1.SearchTemplateService; import au.net.electronichealth.ns.tplt.svc.searchtemplate._1.StandardErrorMsg; @@ -106,7 +106,7 @@ public SearchTemplateClient( * @throws StandardErrorMsg thrown in the event of an operation invocation error. */ public SearchTemplateResponse searchTemplate( - PCEHRHeader commonHeader, + MHRHeader commonHeader, String templateId, TemplateMetadataType templateMetadata ) throws StandardErrorMsg { @@ -132,3 +132,4 @@ public SearchTemplateResponse searchTemplate( return responseHolder.value; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetAuditViewClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetAuditViewClient.java similarity index 81% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetAuditViewClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetAuditViewClient.java index 9012a81..b7fd8c1 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetAuditViewClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetAuditViewClient.java @@ -11,28 +11,28 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.view; +package au.gov.nehta.vendorlibrary.mhr.clients.view; import java.security.PrivateKey; import java.security.cert.X509Certificate; import java.util.Date; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.svc.getauditview._1.GetAuditViewPortType; -import au.net.electronichealth.ns.pcehr.svc.getauditview._1.GetAuditViewService; -import au.net.electronichealth.ns.pcehr.svc.getauditview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getauditview._1.GetAuditView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getauditview._1.GetAuditViewResponse; +import au.net.electronichealth.ns.mhr.svc.getauditview._1.GetAuditViewPortType; +import au.net.electronichealth.ns.mhr.svc.getauditview._1.GetAuditViewService; +import au.net.electronichealth.ns.mhr.svc.getauditview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getauditview._1.GetAuditView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getauditview._1.GetAuditViewResponse; /** * A JAX-WS client to the PCEHR 'Get Audit View' web service. @@ -108,7 +108,7 @@ public GetAuditViewClient( * @return The consolidated view of a PCEHR. * @throws StandardErrorMsg thrown in the event of an operation invocation error. */ - public GetAuditViewResponse getAuditView(PCEHRHeader commonHeader, Date dateFrom, Date dateTo) throws StandardErrorMsg { + public GetAuditViewResponse getAuditView(MHRHeader commonHeader, Date dateFrom, Date dateTo) throws StandardErrorMsg { Validate.notNull(commonHeader, "'commonHeader' must be specified."); Validate.notNull(dateFrom, "'dateFrom' must be specified."); Validate.notNull(dateTo, "'dateTo' must be specified."); @@ -132,3 +132,4 @@ public GetAuditViewResponse getAuditView(PCEHRHeader commonHeader, Date dateFrom return auditView.value; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetChangeHistoryViewClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetChangeHistoryViewClient.java similarity index 80% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetChangeHistoryViewClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetChangeHistoryViewClient.java index e54e067..272e872 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetChangeHistoryViewClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetChangeHistoryViewClient.java @@ -11,27 +11,27 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.view; +package au.gov.nehta.vendorlibrary.mhr.clients.view; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.svc.getchangehistoryview._1.GetChangeHistoryViewPortType; -import au.net.electronichealth.ns.pcehr.svc.getchangehistoryview._1.GetChangeHistoryViewService; -import au.net.electronichealth.ns.pcehr.svc.getchangehistoryview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; +import au.net.electronichealth.ns.mhr.svc.getchangehistoryview._1.GetChangeHistoryViewPortType; +import au.net.electronichealth.ns.mhr.svc.getchangehistoryview._1.GetChangeHistoryViewService; +import au.net.electronichealth.ns.mhr.svc.getchangehistoryview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; /** * A JAX-WS client to the PCEHR 'Get Change History' web service. @@ -103,7 +103,7 @@ public GetChangeHistoryViewClient( * @return The consolidated view of a PCEHR. * @throws StandardErrorMsg thrown in the event of an operation invocation error. */ - public GetChangeHistoryViewResponse getChangeHistoryView(PCEHRHeader commonHeader, String documentId) throws StandardErrorMsg { + public GetChangeHistoryViewResponse getChangeHistoryView(MHRHeader commonHeader, String documentId) throws StandardErrorMsg { Validate.notNull(commonHeader, "'commonHeader' must be specified."); Validate.notEmpty(documentId, "'documentId' must be specified."); @@ -127,3 +127,4 @@ public GetChangeHistoryViewResponse getChangeHistoryView(PCEHRHeader commonHeade return responseHolder.value; } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetDocumentListClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetDocumentListClient.java similarity index 85% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetDocumentListClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetDocumentListClient.java index 15e68f6..1997ac3 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetDocumentListClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetDocumentListClient.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.view; +package au.gov.nehta.vendorlibrary.mhr.clients.view; import ihe.iti.xds_b._2007.DocumentRegistryPortType; import ihe.iti.xds_b._2007.DocumentRegistryService; @@ -20,23 +20,23 @@ import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.XDSMapper; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.XDSMapper; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; /** * A JAX-WS client to the PCEHR 'Get Document List' web service. @@ -106,7 +106,7 @@ public GetDocumentListClient( * @param commonHeader PCEHR common header. * @return A list of the metadata of matching documents. */ - public AdhocQueryResponse getDocumentList(PCEHRHeader commonHeader) { + public AdhocQueryResponse getDocumentList(MHRHeader commonHeader) { Validate.notNull(commonHeader, "'commonHeader' must be specified."); CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. @@ -140,7 +140,7 @@ public AdhocQueryResponse getDocumentList(PCEHRHeader commonHeader) { * @param queryParams populated set of query parameters. * @return A list of the metadata of matching documents. */ - public AdhocQueryResponse getDocumentList(PCEHRHeader commonHeader, DocumentQueryParams queryParams) { + public AdhocQueryResponse getDocumentList(MHRHeader commonHeader, DocumentQueryParams queryParams) { Validate.notNull(commonHeader, "'commonHeader' must be specified."); Validate.notNull(queryParams, "'queryParams' must be specified"); @@ -164,3 +164,4 @@ public AdhocQueryResponse getDocumentList(PCEHRHeader commonHeader, DocumentQuer ); } } + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetIndividualDetailsViewClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetIndividualDetailsViewClient.java new file mode 100644 index 0000000..850c9ee --- /dev/null +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetIndividualDetailsViewClient.java @@ -0,0 +1,150 @@ +/* + * Copyright 2012 NEHTA + * + * Licensed under the NEHTA Open Source (Apache) License; you may not use this + * file except in compliance with the License. A copy of the License is in the + * 'LICENSE.txt' file, which should be provided with this work. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package au.gov.nehta.vendorlibrary.mhr.clients.view; + +import java.security.PrivateKey; +import java.security.cert.X509Certificate; + +import javax.net.ssl.SSLSocketFactory; +import jakarta.xml.ws.Holder; + +import org.apache.commons.lang3.Validate; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; +import au.gov.nehta.xsp.CertificateValidator; +import au.net.electronichealth.ns.mhr.svc.getindividualdetailsview._2.GetIndividualDetailsViewPortType; +import au.net.electronichealth.ns.mhr.svc.getindividualdetailsview._2.GetIndividualDetailsViewService; +import au.net.electronichealth.ns.mhr.svc.getindividualdetailsview._2.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; + +/** + * A JAX-WS client to the PCEHR 'Get Individual Details View' web service. + */ +public class GetIndividualDetailsViewClient extends Client { + + /** + * Constructor - no certificate verification performed. + * + * @param sslSocketFactory the {@link SSLSocketFactory} to be used when + * connecting to the web service provider (mandatory). + * @param x509Certificate the certificate key to be used for signing + * (mandatory) + * @param privateKey the private key to be used for signing (mandatory) + * @param endpointAddress the endpoint address of the web service (mandatory). + * @param setLoggingEnabled set to true to enable logging + * (mandatory). + */ + public GetIndividualDetailsViewClient( + final SSLSocketFactory sslSocketFactory, + final X509Certificate x509Certificate, + final PrivateKey privateKey, + final String endpointAddress, + final boolean setLoggingEnabled) { + super( + GetIndividualDetailsViewService.class, + GetIndividualDetailsViewPortType.class, + sslSocketFactory, + x509Certificate, + privateKey, + endpointAddress, + setLoggingEnabled); + } + + /** + * Constructor - accepts an optional certificate verifier. + * + * @param sslSocketFactory the {@link SSLSocketFactory} to be used when + * connecting to the web service provider + * (mandatory). + * @param x509Certificate the certificate key to be used for signing + * (mandatory) + * @param certificateValidator CertificateValidator implementation (optional). + * @param privateKey the private key to be used for signing + * (mandatory) + * @param endpointAddress the endpoint address of the web service + * (mandatory). + * @param setLoggingEnabled set to true to enable logging + * (mandatory). + */ + public GetIndividualDetailsViewClient( + final SSLSocketFactory sslSocketFactory, + final X509Certificate x509Certificate, + final CertificateValidator certificateValidator, + final PrivateKey privateKey, + final String endpointAddress, + final boolean setLoggingEnabled) { + + super( + GetIndividualDetailsViewService.class, + GetIndividualDetailsViewPortType.class, + sslSocketFactory, + x509Certificate, + certificateValidator, + privateKey, + endpointAddress, + setLoggingEnabled); + } + + /** + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. + * + * @param commonHeader populated {@link MHRHeader} request object (Mandatory). + * @return response (type {@link GetRepresentativeListResponse}) containing + * representative list. + * @throws au.net.electronichealth.ns.mhr.svc.getindividualdetailsview._2.StandardErrorMsg Thrown + * in + * the + * event + * that + * the + * operation + * fails. + * @throws StandardErrorMsg Thrown + * in + * the + * event + * that + * the + * operation + * fails. + */ + public final GetIndividualDetailsViewResponse getIndividualDetailsView(final MHRHeader commonHeader) + throws StandardErrorMsg { + + Validate.notNull(commonHeader, "'commonHeader' must be specified."); + CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. + + // Response holder variables. + + Holder responseHolder = new Holder<>(); + Holder signatureHolder = null; + + // Attempt to call the doesPCEHRExist operation, storing response message values + // in the supplied holders. + getPort().getIndividualDetailsView( + "", + responseHolder, + DateUtils.generateTimestamp(), + signatureHolder, + commonHeader); + + return responseHolder.value; + } +} diff --git a/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetRepresentativeListClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetRepresentativeListClient.java new file mode 100644 index 0000000..625b3e8 --- /dev/null +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetRepresentativeListClient.java @@ -0,0 +1,134 @@ +/* + * Copyright 2012 NEHTA + * + * Licensed under the NEHTA Open Source (Apache) License; you may not use this + * file except in compliance with the License. A copy of the License is in the + * 'LICENSE.txt' file, which should be provided with this work. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package au.gov.nehta.vendorlibrary.mhr.clients.view; + +import java.security.PrivateKey; +import java.security.cert.X509Certificate; + +import javax.net.ssl.SSLSocketFactory; +import jakarta.xml.ws.Holder; + +import org.apache.commons.lang3.Validate; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; +import au.gov.nehta.xsp.CertificateValidator; +import au.net.electronichealth.ns.mhr.svc.getrepresentativelist._1.GetRepresentativeListPortType; +import au.net.electronichealth.ns.mhr.svc.getrepresentativelist._1.GetRepresentativeListService; +import au.net.electronichealth.ns.mhr.svc.getrepresentativelist._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; + +/** + * A JAX-WS client to the PCEHR 'Get Representative List' web service. + */ +public class GetRepresentativeListClient extends Client { + + /** + * Constructor - no certificate verification performed. + * + * @param sslSocketFactory the {@link SSLSocketFactory} to be used when + * connecting to the web service provider (mandatory). + * @param x509Certificate the certificate key to be used for signing + * (mandatory) + * @param privateKey the private key to be used for signing (mandatory) + * @param endpointAddress the endpoint address of the web service (mandatory). + * @param setLoggingEnabled set to true to enable logging + * (mandatory). + */ + public GetRepresentativeListClient( + final SSLSocketFactory sslSocketFactory, + final X509Certificate x509Certificate, + final PrivateKey privateKey, + final String endpointAddress, + final boolean setLoggingEnabled) { + super( + GetRepresentativeListService.class, + GetRepresentativeListPortType.class, + sslSocketFactory, + x509Certificate, + privateKey, + endpointAddress, + setLoggingEnabled); + } + + /** + * Constructor - accepts an optional certificate verifier. + * + * @param sslSocketFactory the {@link SSLSocketFactory} to be used when + * connecting to the web service provider + * (mandatory). + * @param x509Certificate the certificate key to be used for signing + * (mandatory) + * @param certificateValidator CertificateValidator implementation (optional). + * @param privateKey the private key to be used for signing + * (mandatory) + * @param endpointAddress the endpoint address of the web service + * (mandatory). + * @param setLoggingEnabled set to true to enable logging + * (mandatory). + */ + public GetRepresentativeListClient( + final SSLSocketFactory sslSocketFactory, + final X509Certificate x509Certificate, + final CertificateValidator certificateValidator, + final PrivateKey privateKey, + final String endpointAddress, + final boolean setLoggingEnabled) { + + super( + GetRepresentativeListService.class, + GetRepresentativeListPortType.class, + sslSocketFactory, + x509Certificate, + certificateValidator, + privateKey, + endpointAddress, + setLoggingEnabled); + } + + /** + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. + * + * @param commonHeader populated {@link MHRHeader} request object (Mandatory). + * @return response (type {@link GetRepresentativeListResponse}) containing + * representative list. + * @throws StandardErrorMsg Thrown in the event that the operation fails. + */ + public final GetRepresentativeListResponse getRepresentativeList(final MHRHeader commonHeader) + throws StandardErrorMsg { + + Validate.notNull(commonHeader, "'commonHeader' must be specified."); + CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. + + // Response holder variables. + + Holder responseHolder = new Holder<>(); + Holder signatureHolder = null; + + // Attempt to call the doesPCEHRExist operation, storing response message values + // in the supplied holders. + getPort().getRepresentativeList( + "", + responseHolder, + DateUtils.generateTimestamp(), + signatureHolder, + commonHeader); + + return responseHolder.value; + } +} diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetViewClient.java b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetViewClient.java similarity index 53% rename from src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetViewClient.java rename to src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetViewClient.java index 1a3319d..fd7650b 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetViewClient.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/mhr/clients/view/GetViewClient.java @@ -11,39 +11,39 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.clients.view; +package au.gov.nehta.vendorlibrary.mhr.clients.view; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.SSLSocketFactory; -import javax.xml.bind.JAXBException; -import javax.xml.ws.Holder; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.ws.Holder; import org.apache.commons.lang3.Validate; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TypedViewResponse; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TypedViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.svc.getview._1.GetViewPortType; -import au.net.electronichealth.ns.pcehr.svc.getview._1.GetViewService; -import au.net.electronichealth.ns.pcehr.svc.getview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.medicareoverview._1.MedicareOverview; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.observationview._1.ObservationView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; +import au.net.electronichealth.ns.mhr.svc.getview._1.GetViewPortType; +import au.net.electronichealth.ns.mhr.svc.getview._1.GetViewService; +import au.net.electronichealth.ns.mhr.svc.getview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.medicareoverview._1.MedicareOverview; +import au.net.electronichealth.ns.mhr.xsd.interfaces.observationview._1.ObservationView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; /** * A JAX-WS client to the PCEHR 'Get View' web service. @@ -53,19 +53,21 @@ public class GetViewClient extends Client { /** * Constructor - no certificate verification performed. * - * @param sslSocketFactory the {@link SSLSocketFactory} to be used when connecting to the web service provider (mandatory). - * @param x509Certificate the certificate key to be used for signing (mandatory) + * @param sslSocketFactory the {@link SSLSocketFactory} to be used when + * connecting to the web service provider (mandatory). + * @param x509Certificate the certificate key to be used for signing + * (mandatory) * @param privateKey the private key to be used for signing (mandatory) * @param endpointAddress the endpoint address of the web service (mandatory). - * @param setLoggingEnabled set to true to enable logging (mandatory). + * @param setLoggingEnabled set to true to enable logging + * (mandatory). */ public GetViewClient( final SSLSocketFactory sslSocketFactory, final X509Certificate x509Certificate, final PrivateKey privateKey, final String endpointAddress, - final boolean setLoggingEnabled - ) { + final boolean setLoggingEnabled) { super( GetViewService.class, GetViewPortType.class, @@ -73,20 +75,25 @@ public GetViewClient( x509Certificate, privateKey, endpointAddress, - setLoggingEnabled - ); + setLoggingEnabled); setMTOMEnabled(); } /** * Constructor - accepts an optional certificate verifier. * - * @param sslSocketFactory the {@link SSLSocketFactory} to be used when connecting to the web service provider (mandatory). - * @param x509Certificate the certificate key to be used for signing (mandatory) + * @param sslSocketFactory the {@link SSLSocketFactory} to be used when + * connecting to the web service provider + * (mandatory). + * @param x509Certificate the certificate key to be used for signing + * (mandatory) * @param certificateValidator CertificateValidator implementation (optional). - * @param privateKey the private key to be used for signing (mandatory) - * @param endpointAddress the endpoint address of the web service (mandatory). - * @param setLoggingEnabled set to true to enable logging (mandatory). + * @param privateKey the private key to be used for signing + * (mandatory) + * @param endpointAddress the endpoint address of the web service + * (mandatory). + * @param setLoggingEnabled set to true to enable logging + * (mandatory). */ public GetViewClient( final SSLSocketFactory sslSocketFactory, @@ -94,8 +101,7 @@ public GetViewClient( final CertificateValidator certificateValidator, final PrivateKey privateKey, final String endpointAddress, - final boolean setLoggingEnabled - ) { + final boolean setLoggingEnabled) { super( GetViewService.class, @@ -105,135 +111,136 @@ public GetViewClient( certificateValidator, privateKey, endpointAddress, - setLoggingEnabled - ); + setLoggingEnabled); setMTOMEnabled(); } - /* - * Invokes the web service operation that returns a list of representatives associated with a particular individual's PCEHR. - * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). - * @param getViewRequestObject an AchievementDiaryView object for request - * @return response (type {@link GetRepresentativeListResponse}) - * @throws StandardErrorMsg Thrown in the event that the operation fails. - */ - /* - * NOT YET SUPPORTED - * - public final GetViewResponse getView(PCEHRHeader commonHeader, AchievementDiaryView getViewRequestObject) throws StandardErrorMsg { - - return getView( commonHeader, (Object) getViewRequestObject ); - - return responseHolder.value; - } - */ - - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual's PCEHR. + * Invokes getView for a MedicareOverview request. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). * @param getViewRequestObject a MedicareOverview object for request * @return response (type {@link GetViewResponse}) * @throws StandardErrorMsg Thrown in the event that the operation fails. */ - public final GetViewResponse getView(PCEHRHeader commonHeader, MedicareOverview getViewRequestObject) throws StandardErrorMsg { + public final GetViewResponse getView(MHRHeader commonHeader, MedicareOverview getViewRequestObject) + throws StandardErrorMsg { return getView(commonHeader, (Object) getViewRequestObject); } - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual’s PCEHR. + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). * @param getViewRequestObject a ObservationView object for request * @return response (type {@link GetViewResponse}) * @throws StandardErrorMsg Thrown in the event that the operation fails. */ - public final GetViewResponse getView(PCEHRHeader commonHeader, ObservationView getViewRequestObject) throws StandardErrorMsg { + public final GetViewResponse getView(MHRHeader commonHeader, ObservationView getViewRequestObject) + throws StandardErrorMsg { return getView(commonHeader, (Object) getViewRequestObject); } - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual's PCEHR. + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). * @param getViewRequestObject a PrescriptionAndDispenseView object for request * @return response (type {@link GetViewResponse}) * @throws StandardErrorMsg Thrown in the event that the operation fails. */ - public final GetViewResponse getView(PCEHRHeader commonHeader, PrescriptionAndDispenseView getViewRequestObject) throws StandardErrorMsg { + public final GetViewResponse getView(MHRHeader commonHeader, PrescriptionAndDispenseView getViewRequestObject) + throws StandardErrorMsg { return getView(commonHeader, (Object) getViewRequestObject); } - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual's PCEHR. + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). * @param getViewRequestObject a PathologyReportView object for request - * @return response (type {@code TypedViewResponse}) + * @return response (type + * {@code TypedViewResponse}) * @throws StandardErrorMsg Thrown in the event that the operation fails. */ - public final TypedViewResponse getView(PCEHRHeader commonHeader, PathologyReportView getViewRequestObject) throws StandardErrorMsg { + public final TypedViewResponse getView(MHRHeader commonHeader, + PathologyReportView getViewRequestObject) throws StandardErrorMsg { GetViewResponse viewResponse = getView(commonHeader, (Object) getViewRequestObject); return TypedViewResponse.unmarshall(PathologyReportViewResponse.class, viewResponse); } - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual's PCEHR. + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). * @param getViewRequestObject a DiagnosticImagingReportView object for request - * @return response (type {@code TypedViewResponse}) + * @return response (type + * {@code TypedViewResponse}) * @throws StandardErrorMsg Thrown in the event that the operation fails. */ - public final TypedViewResponse getView(PCEHRHeader commonHeader, DiagnosticImagingReportView getViewRequestObject) throws StandardErrorMsg { + public final TypedViewResponse getView(MHRHeader commonHeader, + DiagnosticImagingReportView getViewRequestObject) throws StandardErrorMsg { GetViewResponse viewResponse = getView(commonHeader, (Object) getViewRequestObject); return TypedViewResponse.unmarshall(DiagnosticImagingReportViewResponse.class, viewResponse); } /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual's PCEHR. + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). * @param getViewRequestObject a HealthRecordOverView object for request - * @return response (type {@code TypedViewResponse}) + * @return response (type + * {@code TypedViewResponse}) * @throws StandardErrorMsg Thrown in the event that the operation fails. */ - public final TypedViewResponse getView(PCEHRHeader commonHeader, HealthRecordOverView getViewRequestObject) throws StandardErrorMsg { + public final TypedViewResponse getView(MHRHeader commonHeader, + HealthRecordOverView getViewRequestObject) throws StandardErrorMsg { GetViewResponse viewResponse = getView(commonHeader, (Object) getViewRequestObject); return TypedViewResponse.unmarshall(HealthRecordOverviewResponse.class, viewResponse); } - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual's PCEHR. + * Invokes the web service operation that returns a list of representatives + * associated with a particular individual's PCEHR. *

* This is the type-safe interface that will guarantee no JAXB exceptions * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). * @param getViewRequestObject a HealthCheckScheduleView object for request * @return response (type {@link GetViewResponse}) * @throws StandardErrorMsg Thrown in the event that the operation fails. */ - public final GetViewResponse getView(PCEHRHeader commonHeader, HealthCheckScheduleView getViewRequestObject) throws StandardErrorMsg { + public final GetViewResponse getView(MHRHeader commonHeader, HealthCheckScheduleView getViewRequestObject) + throws StandardErrorMsg { return getView(commonHeader, (Object) getViewRequestObject); } - /** - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). - * @param getViewRequestObject getView Request Object, this object must be 'known' to the client software otherwise there will be + * @param commonHeader populated {@link MHRHeader} request object + * (Mandatory). + * @param getViewRequestObject getView Request Object, this object must be + * 'known' to the client software otherwise there + * will be * a binding error {@link JAXBException} * @return response (type {@link GetViewResponse}) * @throws StandardErrorMsg thrown in the event that the operation fails. - * //throws JAXBException thrown if there is a binding error or the GetView request object is not known to the JAXB context + * //throws JAXBException thrown if there is a binding + * error or the GetView request object is not known to + * the JAXB context */ - public GetViewResponse getView(PCEHRHeader commonHeader, Object getViewRequestObject) throws StandardErrorMsg { + public GetViewResponse getView(MHRHeader commonHeader, Object getViewRequestObject) throws StandardErrorMsg { Validate.notNull(commonHeader, "'commonHeader' must be specified."); CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. @@ -242,11 +249,11 @@ public GetViewResponse getView(PCEHRHeader commonHeader, Object getViewRequestOb Holder responseHolder = new Holder<>(); Holder signatureHolder = null; - GetView getView = new GetView(); getView.setView(getViewRequestObject); - // Attempt to call the doesPCEHRExist operation, storing response message values in the supplied holders. + // Attempt to call the doesPCEHRExist operation, storing response message values + // in the supplied holders. getPort().getView( getView, responseHolder, diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/LoggingHandler.java b/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/LoggingHandler.java deleted file mode 100644 index f5f5aa7..0000000 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/util/LoggingHandler.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2011 NEHTA - * - * Licensed under the NEHTA Open Source (Apache) License; you may not use this - * file except in compliance with the License. A copy of the License is in the - * 'LICENSE.txt' file, which should be provided with this work. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package au.gov.nehta.vendorlibrary.pcehr.clients.common.util; - - -import java.io.ByteArrayOutputStream; -import java.util.Set; -import java.util.logging.Logger; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; -import javax.xml.ws.handler.MessageContext; - -import com.sun.xml.ws.api.handler.MessageHandler; -import com.sun.xml.ws.api.handler.MessageHandlerContext; -import com.sun.xml.ws.api.message.Message; -import com.sun.xml.ws.api.streaming.XMLStreamWriterFactory; - -/** - * This SOAP handler logs incoming and outgoing SOAP messages. If a SOAP handler - * is specified in the handler chain of a JAX-WS client or service, JAX-WS will - * call the SOAP handler before a SOAP message is sent (request) and after a - * SOAP message has been received (response).
- */ -public final class LoggingHandler implements MessageHandler { - - /** - * Constant for empty string. - */ - public static final String EMPTY = ""; - - /** - * Character set encoding to use when serialising the SOAP XML. - */ - public static final String ENCODING = "utf-8"; - - /** - * Logger instance for Logging messages to log output stream - */ - private static final Logger LOG = Logger.getLogger(LoggingHandler.class - .getName()); - - /** - * The SOAP request message corresponding to the most recent web service invocation - */ - private String lastSoapRequest; - - /** - * The SOAP response message corresponding to the most recent web service invocation - */ - private String lastSoapResponse; - - private boolean dump; - - /** - * Default constructor. - * - * @param dump whether or not logging is required. - */ - public LoggingHandler(boolean dump) { - this.dump = dump; - } - - /** - * Getter for lastSoapResponse. - * - * @return lastSoapResponse the lastSoapResponse instance variable - */ - public String getLastSoapResponse() { - return lastSoapResponse; - } - - /** - * Getter for lastSoapRequest. - * - * @return lastSoapRequest the lastSoapRequest instance variable (Mandatory) - */ - public String getLastSoapRequest() { - return lastSoapRequest; - } - - /** - * Logs outgoing and incoming messages. - * - * @param context The SOAP Message context. - * @return {@link Boolean}.TRUE handle message is successful else return - * FALSE - * @see javax.xml.ws.handler.Handler#handleMessage(javax.xml.ws.handler.MessageContext) - */ - public boolean handleMessage(final MessageHandlerContext context) { - // log to SOAP message to console - logSOAPMessage(context); - return true; // Continue processing - } - - /** - * Logs outgoing and incoming faults. - * - * @param context the SOAP message context object to provide access to the SOAP message for either RPC request or - * response - * @return {@link Boolean}.TRUE if handleFault is successful, else returns - * {@link Boolean}.FALSE - * @see javax.xml.ws.handler.Handler#handleFault(javax.xml.ws.handler.MessageContext) - */ - public boolean handleFault(final MessageHandlerContext context) { - // log to SOAP message to console - logSOAPMessage(context); - return true; // Continue processing - } - - /** - * Logs outgoing and incoming faults. - * - * @param context the SOAP Message context - */ - private void logSOAPMessage(final MessageHandlerContext context) { - boolean outgoing = (Boolean) context - .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); - if (outgoing) { - lastSoapRequest = getSoapAsString(context); - if (dump) { - LOG.info("Outgoing" + lastSoapRequest); - } - } else { - lastSoapResponse = getSoapAsString(context); - if (dump) { - LOG.info("Incoming" + lastSoapResponse); - } - } - } - - private String getSoapAsString(MessageHandlerContext mhc) { - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - - //IMPORTANT: always work from the copy! - Message m = mhc.getMessage().copy(); - - XMLStreamWriter writer = XMLStreamWriterFactory.create(baos); - String soap = ""; - try { - m.writeTo(writer); - soap = baos.toString(); - - } catch (XMLStreamException e) { - LOG.severe("Error logging soap message: " + e.getMessage()); - } - - - return soap; - } - - /** - * Ignore processing of SOAP header as the primary intention is just to - * 'Dump' the SOAP message. - * - * @return SOAP header names processed by this handler - * @see javax.xml.ws.handler.soap.SOAPHandler#getHeaders() - */ - public Set getHeaders() { - return null; - } - - /** - * Does nothing
- * Not utilised for dumping SOAP message. - * - * @param context the SOAP Message context - * @see javax.xml.ws.handler.Handler#close(javax.xml.ws.handler.MessageContext) - */ - public void close(final MessageContext context) { - } -} diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetIndividualDetailsViewClient.java b/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetIndividualDetailsViewClient.java deleted file mode 100644 index 6732b25..0000000 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetIndividualDetailsViewClient.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2012 NEHTA - * - * Licensed under the NEHTA Open Source (Apache) License; you may not use this - * file except in compliance with the License. A copy of the License is in the - * 'LICENSE.txt' file, which should be provided with this work. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package au.gov.nehta.vendorlibrary.pcehr.clients.view; - -import java.security.PrivateKey; -import java.security.cert.X509Certificate; - -import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; - -import org.apache.commons.lang3.Validate; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; -import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.svc.getindividualdetailsview._2.GetIndividualDetailsViewPortType; -import au.net.electronichealth.ns.pcehr.svc.getindividualdetailsview._2.GetIndividualDetailsViewService; -import au.net.electronichealth.ns.pcehr.svc.getindividualdetailsview._2.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; - -/** - * A JAX-WS client to the PCEHR 'Get Individual Details View' web service. - */ -public class GetIndividualDetailsViewClient extends Client { - - /** - * Constructor - no certificate verification performed. - * - * @param sslSocketFactory the {@link SSLSocketFactory} to be used when connecting to the web service provider (mandatory). - * @param x509Certificate the certificate key to be used for signing (mandatory) - * @param privateKey the private key to be used for signing (mandatory) - * @param endpointAddress the endpoint address of the web service (mandatory). - * @param setLoggingEnabled set to true to enable logging (mandatory). - */ - public GetIndividualDetailsViewClient( - final SSLSocketFactory sslSocketFactory, - final X509Certificate x509Certificate, - final PrivateKey privateKey, - final String endpointAddress, - final boolean setLoggingEnabled - ) { - super( - GetIndividualDetailsViewService.class, - GetIndividualDetailsViewPortType.class, - sslSocketFactory, - x509Certificate, - privateKey, - endpointAddress, - setLoggingEnabled - ); - } - - /** - * Constructor - accepts an optional certificate verifier. - * - * @param sslSocketFactory the {@link SSLSocketFactory} to be used when connecting to the web service provider (mandatory). - * @param x509Certificate the certificate key to be used for signing (mandatory) - * @param certificateValidator CertificateValidator implementation (optional). - * @param privateKey the private key to be used for signing (mandatory) - * @param endpointAddress the endpoint address of the web service (mandatory). - * @param setLoggingEnabled set to true to enable logging (mandatory). - */ - public GetIndividualDetailsViewClient( - final SSLSocketFactory sslSocketFactory, - final X509Certificate x509Certificate, - final CertificateValidator certificateValidator, - final PrivateKey privateKey, - final String endpointAddress, - final boolean setLoggingEnabled - ) { - - super( - GetIndividualDetailsViewService.class, - GetIndividualDetailsViewPortType.class, - sslSocketFactory, - x509Certificate, - certificateValidator, - privateKey, - endpointAddress, - setLoggingEnabled - ); - } - - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual’s PCEHR. - * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). - * @return response (type {@link GetRepresentativeListResponse}) containing representative list. - * @throws au.net.electronichealth.ns.pcehr.svc.getindividualdetailsview._2.StandardErrorMsg Thrown in the event that the operation fails. - * @throws StandardErrorMsg Thrown in the event that the operation fails. - */ - public final GetIndividualDetailsViewResponse getIndividualDetailsView(final PCEHRHeader commonHeader) throws StandardErrorMsg { - - Validate.notNull(commonHeader, "'commonHeader' must be specified."); - CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. - - // Response holder variables. - - Holder responseHolder = new Holder<>(); - Holder signatureHolder = null; - - // Attempt to call the doesPCEHRExist operation, storing response message values in the supplied holders. - getPort().getIndividualDetailsView( - "", - responseHolder, - DateUtils.generateTimestamp(), - signatureHolder, - commonHeader); - - return responseHolder.value; - } -} diff --git a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetRepresentativeListClient.java b/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetRepresentativeListClient.java deleted file mode 100644 index c2ec9b8..0000000 --- a/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/view/GetRepresentativeListClient.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2012 NEHTA - * - * Licensed under the NEHTA Open Source (Apache) License; you may not use this - * file except in compliance with the License. A copy of the License is in the - * 'LICENSE.txt' file, which should be provided with this work. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package au.gov.nehta.vendorlibrary.pcehr.clients.view; - -import java.security.PrivateKey; -import java.security.cert.X509Certificate; - -import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; - -import org.apache.commons.lang3.Validate; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.Client; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; -import au.gov.nehta.xsp.CertificateValidator; -import au.net.electronichealth.ns.pcehr.svc.getrepresentativelist._1.GetRepresentativeListPortType; -import au.net.electronichealth.ns.pcehr.svc.getrepresentativelist._1.GetRepresentativeListService; -import au.net.electronichealth.ns.pcehr.svc.getrepresentativelist._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; - -/** - * A JAX-WS client to the PCEHR 'Get Representative List' web service. - */ -public class GetRepresentativeListClient extends Client { - - /** - * Constructor - no certificate verification performed. - * - * @param sslSocketFactory the {@link SSLSocketFactory} to be used when connecting to the web service provider (mandatory). - * @param x509Certificate the certificate key to be used for signing (mandatory) - * @param privateKey the private key to be used for signing (mandatory) - * @param endpointAddress the endpoint address of the web service (mandatory). - * @param setLoggingEnabled set to true to enable logging (mandatory). - */ - public GetRepresentativeListClient( - final SSLSocketFactory sslSocketFactory, - final X509Certificate x509Certificate, - final PrivateKey privateKey, - final String endpointAddress, - final boolean setLoggingEnabled - ) { - super( - GetRepresentativeListService.class, - GetRepresentativeListPortType.class, - sslSocketFactory, - x509Certificate, - privateKey, - endpointAddress, - setLoggingEnabled - ); - } - - /** - * Constructor - accepts an optional certificate verifier. - * - * @param sslSocketFactory the {@link SSLSocketFactory} to be used when connecting to the web service provider (mandatory). - * @param x509Certificate the certificate key to be used for signing (mandatory) - * @param certificateValidator CertificateValidator implementation (optional). - * @param privateKey the private key to be used for signing (mandatory) - * @param endpointAddress the endpoint address of the web service (mandatory). - * @param setLoggingEnabled set to true to enable logging (mandatory). - */ - public GetRepresentativeListClient( - final SSLSocketFactory sslSocketFactory, - final X509Certificate x509Certificate, - final CertificateValidator certificateValidator, - final PrivateKey privateKey, - final String endpointAddress, - final boolean setLoggingEnabled - ) { - - super( - GetRepresentativeListService.class, - GetRepresentativeListPortType.class, - sslSocketFactory, - x509Certificate, - certificateValidator, - privateKey, - endpointAddress, - setLoggingEnabled - ); - } - - /** - * Invokes the web service operation that returns a list of representatives associated with a particular individual’s PCEHR. - * - * @param commonHeader populated {@link PCEHRHeader} request object (Mandatory). - * @return response (type {@link GetRepresentativeListResponse}) containing representative list. - * @throws StandardErrorMsg Thrown in the event that the operation fails. - */ - public final GetRepresentativeListResponse getRepresentativeList(final PCEHRHeader commonHeader) throws StandardErrorMsg { - - Validate.notNull(commonHeader, "'commonHeader' must be specified."); - CommonHeaderValidator.validate(commonHeader, true); // IHINumber is required. - - // Response holder variables. - - Holder responseHolder = new Holder<>(); - Holder signatureHolder = null; - - // Attempt to call the doesPCEHRExist operation, storing response message values in the supplied holders. - getPort().getRepresentativeList( - "", - responseHolder, - DateUtils.generateTimestamp(), - signatureHolder, - commonHeader - ); - - return responseHolder.value; - } -} diff --git a/src/revisions.txt b/src/revisions.txt index ea8a628..9e4ea46 100644 --- a/src/revisions.txt +++ b/src/revisions.txt @@ -25,7 +25,7 @@ 1.1.1 ----------------- -* Updated PCEHR wsdl jar to nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.4.1.jar +* Updated PCEHR wsdl jar to nehta-vendorlibrary-java-mhr-wsdl-2.4.1.jar + added new DocumentTypeCodes for Pathology and DI * modified XDS Metadata service start stop time for pathology/di @@ -86,7 +86,7 @@ 0.7.8 (DRAFT) ------------------ -* Modifications To RegisterPCEHRClient and Client.javato fix a bug with MTOM. +* Modifications To RegisterMHRClient and Client.javato fix a bug with MTOM. NB:this release is backward-compatible with Java 6. @@ -218,7 +218,7 @@ Known Limitations: Change History: + Enhancement to allow client properties to be set using 'setProperty' method. For instance: - DoesPCEHRExistClient client = ... // constructor call + DoesMHRExistClient client = ... // constructor call client.setProperty(JAXWSProperties.CONNECT_TIMEOUT, 180000); // Timeout of three minutes. * Abstraction of client code to improve manageability. + Accessor method for 'Client' port. @@ -281,7 +281,7 @@ Pre-Requisites: + SVT 5.11 (or greater) environment required for support of: 1) CDA document root value of type UUID in document uploads. 2) Signature verification - 3) 'GetRepresentativeList' and 'RegisterPCEHR' clients. + 3) 'GetRepresentativeList' and 'RegisterMHR' clients. Change History: * Fix for 'UploadDocument' submission set metadata association for document replacement. @@ -302,17 +302,17 @@ Pre-Requisites: + SVT 5.11 (or greater) environment required for support of: 1) CDA document root value of type UUID in document uploads. 2) Signature verification - 3) 'GetRepresentativeList' and 'RegisterPCEHR' clients. + 3) 'GetRepresentativeList' and 'RegisterMHR' clients. Change History: -* Modified 'RegisterPCEHR' sample code to provide an correct example for: +* Modified 'RegisterMHR' sample code to provide an correct example for: 1) registering a PCEHR with an IHI (child-specific sample code, with parent assertion details) 2) registering a PCEHR with demographics (individual-specific code) - Inclusion of generated code JAR files supporting the deprecation of the 'GetIndividualDetails' operation: - 1) nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.1.0-docs.jar - 2) nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.1.0-sources.jar - 3) nehta-vendorlibrary-java-pcehr-compiled-wsdl-2.1.0.jar + 1) nehta-vendorlibrary-java-mhr-wsdl-2.1.0-docs.jar + 2) nehta-vendorlibrary-java-mhr-wsdl-2.1.0-sources.jar + 3) nehta-vendorlibrary-java-mhr-wsdl-2.1.0.jar 0.6.0 (DRAFT) ------------------ @@ -323,12 +323,12 @@ Pre-Requisites: + SVT 5.11 (or greater) environment required for support of: 1) CDA document root value of type UUID in document uploads. 2) Signature verification - 3) 'GetRepresentativeList' and 'RegisterPCEHR' clients. + 3) 'GetRepresentativeList' and 'RegisterMHR' clients. Change History: * Abstraction of some common client behaviour to improve manageability. * Updated 'license.txt' with new license text for vendor library usage. -+ Added 'RegisterPCEHR' client and sample code. ++ Added 'RegisterMHR' client and sample code. + Added 'GetRepresentativeList' client and sample code. + Added response signature verification to 'SecurityHandler', utilising XSP libraries. For further detail on the verification process, please see the '/lib/provided/nehta-smi-xsp-1.0.3*.jar' libraries. diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleEndpoints.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleEndpoints.java similarity index 97% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleEndpoints.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleEndpoints.java index 0e5f565..5db9043 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleEndpoints.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleEndpoints.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.constants; +package au.gov.nehta.vendorlibrary.mhr.sample.common.constants; /** * Sample endpoints used in sample code. These should be replaced with the appropriate, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleSecurityConstants.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleSecurityConstants.java similarity index 96% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleSecurityConstants.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleSecurityConstants.java index 1c5e686..0bd2b61 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleSecurityConstants.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleSecurityConstants.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.constants; +package au.gov.nehta.vendorlibrary.mhr.sample.common.constants; /** * Sample security constants used in sample code. These values should be replaced with valid details. diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleValues.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleValues.java similarity index 82% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleValues.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleValues.java index 46f84ee..a830255 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleValues.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleValues.java @@ -11,12 +11,12 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.constants; +package au.gov.nehta.vendorlibrary.mhr.sample.common.constants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TemplateServiceRequestorOption; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TemplateServiceRequestorOption; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; import au.net.electronichealth.ns.tplt.xsd.common.templatescoreelements._1.TemplateMetadataType; /** @@ -28,7 +28,7 @@ public final class SampleValues { /** * User - ID type. */ - public static final PCEHRHeader.User.IDType USER_ID_TYPE = PCEHRHeader.User.IDType.HPII; + public static final MHRHeader.User.IDType USER_ID_TYPE = MHRHeader.User.IDType.HPII; /** * User - ID. @@ -78,12 +78,12 @@ public final class SampleValues { /** * Client system type - CIS. */ - public static final PCEHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CIS = PCEHRHeader.ClientSystemType.CIS; + public static final MHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CIS = MHRHeader.ClientSystemType.CIS; /** * Client system type - CRP. */ - public static final PCEHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CRP = PCEHRHeader.ClientSystemType.CRP; + public static final MHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CRP = MHRHeader.ClientSystemType.CRP; /** * Accessing Organisation - Organisation ID. @@ -103,7 +103,7 @@ public final class SampleValues { /** * Authorisation Details - Access type. */ - public static final GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType AUTHORISATION_DETAILS_ACCESS_TYPE = GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS; + public static final GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType AUTHORISATION_DETAILS_ACCESS_TYPE = GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS; /** * Authorisation Details - Access code. diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/DocumentUtils.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/DocumentUtils.java similarity index 95% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/DocumentUtils.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/DocumentUtils.java index 5dc9fa0..b9d0be1 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/DocumentUtils.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/DocumentUtils.java @@ -1,6 +1,6 @@ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.util; +package au.gov.nehta.vendorlibrary.mhr.sample.common.util; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; import org.apache.commons.lang3.Validate; import org.w3c.dom.Document; import org.w3c.dom.NodeList; @@ -16,7 +16,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -93,3 +93,4 @@ private byte[] modifyDocId(byte[] templateContent, Holder currentId) thr return out.toByteArray(); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/MessageComponents.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/MessageComponents.java similarity index 65% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/MessageComponents.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/MessageComponents.java index 8141a13..e122749 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/MessageComponents.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/MessageComponents.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.util; +package au.gov.nehta.vendorlibrary.mhr.sample.common.util; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; /** * Helper class to create common components of a SOAP message. @@ -33,13 +33,13 @@ private MessageComponents() { * Create PCEHR record with no individual records. * * @param authorisationDetails authorisation details. - * @return populated {@link GainPCEHRAccess.PCEHRRecord} object. + * @return populated {@link GainMHRAccess.MHRRecord} object. */ - public static GainPCEHRAccess.PCEHRRecord createGainPCEHRRecord + public static GainMHRAccess.MHRRecord createGainMHRRecord ( - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails authorisationDetails + GainMHRAccess.MHRRecord.AuthorisationDetails authorisationDetails ) { - GainPCEHRAccess.PCEHRRecord record = new GainPCEHRAccess.PCEHRRecord(); + GainMHRAccess.MHRRecord record = new GainMHRAccess.MHRRecord(); record.setIndividual(null); record.setAuthorisationDetails(authorisationDetails); return record; @@ -50,37 +50,37 @@ private MessageComponents() { * * @param accessType Authorisation access type. * @param accessCode Authorisation access code. - * @return populated {@link GainPCEHRAccess.PCEHRRecord.AuthorisationDetails} object. + * @return populated {@link GainMHRAccess.MHRRecord.AuthorisationDetails} object. */ - public static GainPCEHRAccess.PCEHRRecord.AuthorisationDetails createAuthorisationDetails( - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType accessType, + public static GainMHRAccess.MHRRecord.AuthorisationDetails createAuthorisationDetails( + GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType accessType, String accessCode ) { - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails authorisationDetails = new GainPCEHRAccess.PCEHRRecord.AuthorisationDetails(); + GainMHRAccess.MHRRecord.AuthorisationDetails authorisationDetails = new GainMHRAccess.MHRRecord.AuthorisationDetails(); authorisationDetails.setAccessType(accessType); authorisationDetails.setAccessCode(accessCode); return authorisationDetails; } /** - * Create a PCEHRHeader request with custom pre-populated objects. + * Create a MHRHeader request with custom pre-populated objects. * * @param user Populated user. * @param ihiNumber IHI number. * @param productType Populated product type. * @param clientSystemType Client system type. * @param accessingOrganisation Populated accessing organisation. - * @return Populated {@link au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader} + * @return Populated {@link au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader} */ - public static PCEHRHeader createRequest( - PCEHRHeader.User user, + public static MHRHeader createRequest( + MHRHeader.User user, String ihiNumber, - PCEHRHeader.ProductType productType, - PCEHRHeader.ClientSystemType clientSystemType, - PCEHRHeader.AccessingOrganisation accessingOrganisation + MHRHeader.ProductType productType, + MHRHeader.ClientSystemType clientSystemType, + MHRHeader.AccessingOrganisation accessingOrganisation ) { // Instantiate new request header. - PCEHRHeader request = new PCEHRHeader(); + MHRHeader request = new MHRHeader(); // Populate request. request.setUser(user); @@ -101,17 +101,17 @@ public static PCEHRHeader createRequest( * @param role User role. * @param userName User name. * @param useRoleForAudit Whether or not to use user role for audit purposes. - * @return Populated {@link PCEHRHeader.User} object. + * @return Populated {@link MHRHeader.User} object. */ - public static PCEHRHeader.User createUser( - PCEHRHeader.User.IDType idType, + public static MHRHeader.User createUser( + MHRHeader.User.IDType idType, String id, String role, String userName, boolean useRoleForAudit ) { // Populate user. - PCEHRHeader.User user = new PCEHRHeader.User(); + MHRHeader.User user = new MHRHeader.User(); user.setIDType(idType); user.setID(id); user.setRole(role); @@ -127,15 +127,15 @@ public static PCEHRHeader.User createUser( * @param productName Product name. * @param productVersion Product version. * @param platform Product platform. - * @return Populated {@link PCEHRHeader.ProductType} object. + * @return Populated {@link MHRHeader.ProductType} object. */ - public static PCEHRHeader.ProductType createProductType( + public static MHRHeader.ProductType createProductType( String vendor, String productName, String productVersion, String platform ) { - PCEHRHeader.ProductType productType = new PCEHRHeader.ProductType(); + MHRHeader.ProductType productType = new MHRHeader.ProductType(); productType.setVendor(vendor); productType.setProductName(productName); productType.setProductVersion(productVersion); @@ -149,15 +149,15 @@ public static PCEHRHeader.ProductType createProductType( * @param organisationId Accessing organisation id. * @param organisationName Accessing organisation name. * @param alternateOrganisationName Access organisation alternate name. - * @return Populated {@link PCEHRHeader.AccessingOrganisation} object. + * @return Populated {@link MHRHeader.AccessingOrganisation} object. */ - public static PCEHRHeader.AccessingOrganisation createAccessingOrganisation( + public static MHRHeader.AccessingOrganisation createAccessingOrganisation( String organisationId, String organisationName, String alternateOrganisationName ) { // Populate accessing organisation. - PCEHRHeader.AccessingOrganisation accessingOrganisation = new PCEHRHeader.AccessingOrganisation(); + MHRHeader.AccessingOrganisation accessingOrganisation = new MHRHeader.AccessingOrganisation(); accessingOrganisation.setOrganisationID(organisationId); accessingOrganisation.setOrganisationName(organisationName); accessingOrganisation.setAlternateOrganisationName(alternateOrganisationName); diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/SecurityUtil.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/SecurityUtil.java similarity index 96% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/SecurityUtil.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/SecurityUtil.java index 2f17997..ac53c30 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/SecurityUtil.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/SecurityUtil.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.util; +package au.gov.nehta.vendorlibrary.mhr.sample.common.util; import au.gov.nehta.vendorlibrary.common.security.KeystoreUtil; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleSecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleSecurityConstants; import javax.net.ssl.SSLSocketFactory; import java.io.IOException; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/GetDocumentSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/GetDocumentSample.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/GetDocumentSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/GetDocumentSample.java index 073fe5c..cb9806a 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/GetDocumentSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/GetDocumentSample.java @@ -11,14 +11,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/RemoveDocumentSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/RemoveDocumentSample.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/RemoveDocumentSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/RemoveDocumentSample.java index 63ac50d..0eb7ecb 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/RemoveDocumentSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/RemoveDocumentSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -67,7 +67,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -76,7 +76,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -84,14 +84,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentMetadataSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentMetadataSample.java similarity index 75% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentMetadataSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentMetadataSample.java index cd7274f..9e92dd5 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentMetadataSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentMetadataSample.java @@ -11,19 +11,19 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentMetadataClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentMetadataClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.xml.sax.SAXException; @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentSample.java similarity index 80% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentSample.java index ec475c4..d41f3a2 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentSample.java @@ -11,19 +11,19 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.xml.sax.SAXException; @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/examples/CertificateVerifierUsageSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/examples/CertificateVerifierUsageSample.java similarity index 72% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/examples/CertificateVerifierUsageSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/examples/CertificateVerifierUsageSample.java index 9ae423b..58ec9a5 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/examples/CertificateVerifierUsageSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/examples/CertificateVerifierUsageSample.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.examples; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MinimalCertificateVerifier; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.examples; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MinimalCertificateVerifier; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -41,7 +41,7 @@ private CertificateVerifierUsageSample() { public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - DoesPCEHRExistClient client; + DoesMHRExistClient client; // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); @@ -55,7 +55,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * socket factory; // * endpoint URI string; and // * set logging on/off. - client = new DoesPCEHRExistClient( + client = new DoesMHRExistClient( sslSocketFactory, SecurityUtil.getCertificate(), new MinimalCertificateVerifier(), // Note: this is where an instance of the certificate verifier is supplied. @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, @@ -106,7 +106,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Call operation. - DoesPCEHRExistResponse response = client.doesPCEHRExist(commonHeader); + DoesMHRExistResponse response = client.doesPCEHRExist(commonHeader); // Process response. System.out.println("PCEHR Exists: " + response.isPCEHRExists()); diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/DoesMHRExistSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/DoesMHRExistSample.java new file mode 100644 index 0000000..7d59d7d --- /dev/null +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/DoesMHRExistSample.java @@ -0,0 +1,107 @@ +/* + * Copyright 2012 NEHTA + * + * Licensed under the NEHTA Open Source (Apache) License; you may not use this + * file except in compliance with the License. A copy of the License is in the + * 'LICENSE.txt' file, which should be provided with this work. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package au.gov.nehta.vendorlibrary.mhr.sample.recordaccess; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSocketFactory; +import java.io.IOException; +import java.security.GeneralSecurityException; + +/** + * An example class showing usage of the Does PCEHR Exist web service client. + */ +public final class DoesMHRExistSample { + + private DoesMHRExistSample() { + + } + + public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { + + DoesMHRExistClient client; + + // Sets the newly created sslsocketfactory as the default for all instances of + // the HttpsURLConnection class. + SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); + HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory); + + // For testing purposes. + System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); + + // Instantiate client, providing: + // + // * socket factory; + // * endpoint URI string; and + // * set logging on/off. + client = new DoesMHRExistClient( + sslSocketFactory, + SecurityUtil.getCertificate(), + SecurityUtil.getPrivateKey(), + SampleEndpoints.DOES_PCEHR_EXIST, + true); + + // Create a sample PCEHR header consisting of: + // + // * User; + // * IHI number; + // * Product type; + // * Client system type; and + // * Accessing organisation. + + // Create a sample user, using helper method. + MHRHeader.User user = MessageComponents.createUser( + SampleValues.USER_ID_TYPE, + SampleValues.USER_ID, + SampleValues.USER_ROLE, + SampleValues.USER_NAME, + SampleValues.USER_USE_ROLE_FOR_AUDIT); + + // Create a sample product type, using helper method. + MHRHeader.ProductType productType = MessageComponents.createProductType( + SampleValues.PRODUCT_TYPE_VENDOR, + SampleValues.PRODUCT_NAME, + SampleValues.PRODUCT_VERSION, + SampleValues.PRODUCT_PLATFORM); + + // Create a sample accessing organisation, using helper method. + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + SampleValues.ACCESSING_ORGANISATION_ID, + SampleValues.ACCESSING_ORGANISATION_NAME, + SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME); + + // Create a sample PCEHR request header, using helper method. + MHRHeader commonHeader = MessageComponents.createRequest( + user, + SampleValues.IHI_NUMBER, + productType, + SampleValues.CLIENT_SYSTEM_TYPE_CIS, + accessingOrganisation); + + // Call operation. + DoesMHRExistResponse response = client.doesPCEHRExist(commonHeader); + + // Process response. + System.out.println("PCEHR Exists: " + response.isPCEHRExists()); + System.out.println("Access Code Required: " + response.getAccessCodeRequired()); + } +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/GainPCEHRAccessSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/GainMHRAccessSample.java similarity index 67% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/GainPCEHRAccessSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/GainMHRAccessSample.java index ee5bba5..e7b9ba7 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/GainPCEHRAccessSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/GainMHRAccessSample.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.recordaccess; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.GainPCEHRAccessClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccessResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.recordaccess; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccessResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -31,15 +31,15 @@ /** * An example class showing usage of the Gain PCEHR Access web service client. */ -public final class GainPCEHRAccessSample { +public final class GainMHRAccessSample { - private GainPCEHRAccessSample() { + private GainMHRAccessSample() { } public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - GainPCEHRAccessClient client; + GainMHRAccessClient client; // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); @@ -53,7 +53,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * socket factory; // * endpoint URI string; and // * set logging on/off. - client = new GainPCEHRAccessClient( + client = new GainMHRAccessClient( sslSocketFactory, SecurityUtil.getCertificate(), SecurityUtil.getPrivateKey(), @@ -66,13 +66,13 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // Create a sample authorisation details, using helper method. // // Note: For this example, EmergencyAccess type is used so code is not required (ie. null). - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails authorisationDetails = MessageComponents.createAuthorisationDetails( + GainMHRAccess.MHRRecord.AuthorisationDetails authorisationDetails = MessageComponents.createAuthorisationDetails( SampleValues.AUTHORISATION_DETAILS_ACCESS_TYPE, SampleValues.AUTHORISATION_DETAILS_ACCESS_CODE ); // Create a sample PCEHR record, using helper method. - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(authorisationDetails); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(authorisationDetails); // Create a sample PCEHR header consisting of: // @@ -83,7 +83,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -92,7 +92,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -100,14 +100,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, @@ -116,7 +116,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Call operation. - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, commonHeader); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, commonHeader); // Process response. System.out.println("Individual IHI : " + response.getIndividual().getIhiNumber()); diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/registration/RegisterPCEHRSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/registration/RegisterMHRSample.java similarity index 67% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/registration/RegisterPCEHRSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/registration/RegisterMHRSample.java index b9f498a..9aeb07b 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/registration/RegisterPCEHRSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/registration/RegisterMHRSample.java @@ -11,31 +11,31 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.registration; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentConsentCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.EvidenceOfIdentityCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IVCCorrespondeceChannelCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IndigenousStatusCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.registration.RegisterPCEHRClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.ContactDetailsType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.NameTypeSupp; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Sex; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Representative; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.DocumentConsent; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.IvcCorrespondence; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.DocumentConsent.Document; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity.EvidenceOfIdentity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHRResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.registration; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentConsentCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.EvidenceOfIdentityCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IVCCorrespondeceChannelCode; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IndigenousStatusCode; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.registration.RegisterMHRClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.ContactDetailsType; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.NameTypeSupp; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Sex; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Representative; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.DocumentConsent; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.IvcCorrespondence; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.DocumentConsent.Document; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity.EvidenceOfIdentity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHRResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -51,17 +51,17 @@ /** * An example class showing usage of the Register PCEHR web service client. */ -public class RegisterPCEHRSample { +public class RegisterMHRSample { - private RegisterPCEHRSample() { + private RegisterMHRSample() { } public static void main(String[] args) throws IOException, GeneralSecurityException, - au.net.electronichealth.ns.pcehr.svc.registerpcehr._2.StandardErrorMsg { + au.net.electronichealth.ns.mhr.svc.registermhr._2.StandardErrorMsg { - RegisterPCEHRClient client; + RegisterMHRClient client; // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); @@ -75,7 +75,7 @@ public static void main(String[] args) throws // * socket factory; // * endpoint URI string; and // * set logging on/off. - client = new RegisterPCEHRClient( + client = new RegisterMHRClient( sslSocketFactory, SecurityUtil.getCertificate(), SecurityUtil.getPrivateKey(), @@ -92,7 +92,7 @@ public static void main(String[] args) throws // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -101,7 +101,7 @@ public static void main(String[] args) throws ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -109,14 +109,14 @@ public static void main(String[] args) throws ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, @@ -127,7 +127,7 @@ public static void main(String[] args) throws /** * In terms of the information required to register a PCEHR, there are two distinct options: * - * 1. An IHI is provided in the PCEHRHeader (or in the child IHI, if registering a child for a PCEHR). + * 1. An IHI is provided in the MHRHeader (or in the child IHI, if registering a child for a PCEHR). * 2. Demographic information in instances where the IHI is not specified (or in the child demographics, * if registering a child for a PCEHR). * @@ -136,13 +136,13 @@ public static void main(String[] args) throws */ // Register PCEHR - child w/IHI. - RegisterPCEHR registrationDetails = generateChildWithIHI(); + RegisterMHR registrationDetails = generateChildWithIHI(); // Register PCEHR - person w/demographics. - // ** Uncomment ** RegisterPCEHR registrationDetails = generatePersonWithDemographics(); + // ** Uncomment ** RegisterMHR registrationDetails = generatePersonWithDemographics(); // Call operation. - RegisterPCEHRResponse response = client.registerPCEHR(commonHeader, registrationDetails); + RegisterMHRResponse response = client.registerPCEHR(commonHeader, registrationDetails); // Process response. System.out.println("Registration Status: " + response.getResponseStatus().getCode()); @@ -151,13 +151,13 @@ public static void main(String[] args) throws /** * Generate the registration for a child. * - * @return Populated {@link RegisterPCEHR} + * @return Populated {@link RegisterMHR} */ - private static RegisterPCEHR generateChildWithIHI() { + private static RegisterMHR generateChildWithIHI() { - RegisterPCEHR registrationDetails = new RegisterPCEHR(); + RegisterMHR registrationDetails = new RegisterMHR(); - RegisterPCEHR.Assertions assertions = new RegisterPCEHR.Assertions(); + RegisterMHR.Assertions assertions = new RegisterMHR.Assertions(); // Note the need to define this registration request as a parent on behalf of their child. @@ -194,7 +194,7 @@ private static RegisterPCEHR generateChildWithIHI() { /** * Populate a new child. */ - //RegisterPCEHR.Child child = new RegisterPCEHR.Child(); + //RegisterMHR.Child child = new RegisterMHR.Child(); // child.setIhiNumber(""); registrationDetails.setAssertions(assertions); @@ -206,13 +206,13 @@ private static RegisterPCEHR generateChildWithIHI() { /** * Generate the registration for a person. * - * @return Populated {@link RegisterPCEHR} + * @return Populated {@link RegisterMHR} */ - private static RegisterPCEHR generatePersonWithDemographics() { + private static RegisterMHR generatePersonWithDemographics() { - RegisterPCEHR registrationDetails = new RegisterPCEHR(); + RegisterMHR registrationDetails = new RegisterMHR(); - RegisterPCEHR.Assertions assertions = new RegisterPCEHR.Assertions(); + RegisterMHR.Assertions assertions = new RegisterMHR.Assertions(); assertions.setAcceptedTermsAndConditions( true ); @@ -252,9 +252,9 @@ private static RegisterPCEHR generatePersonWithDemographics() { /** * Populate a new individual. */ - RegisterPCEHR.Individual individual = new RegisterPCEHR.Individual(); + RegisterMHR.Individual individual = new RegisterMHR.Individual(); - RegisterPCEHR.Individual.Demographics demographics = new RegisterPCEHR.Individual.Demographics(); + RegisterMHR.Individual.Demographics demographics = new RegisterMHR.Individual.Demographics(); // Populate the individual's name. NameTypeSupp name = new NameTypeSupp(); @@ -273,7 +273,7 @@ private static RegisterPCEHR generatePersonWithDemographics() { //If a Representative exists Representative representative = new Representative(); - RegisterPCEHR.Representative.Demographics repDemographics = new RegisterPCEHR.Representative.Demographics(); + RegisterMHR.Representative.Demographics repDemographics = new RegisterMHR.Representative.Demographics(); // Populate the representative's name. NameTypeSupp repName = new NameTypeSupp(); diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/GetTemplateSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/template/GetTemplateSample.java similarity index 80% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/GetTemplateSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/template/GetTemplateSample.java index 1bd90fe..7efe62b 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/GetTemplateSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/template/GetTemplateSample.java @@ -11,14 +11,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.template; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.GetTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.template; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.template.GetTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import au.net.electronichealth.ns.tplt.svc.searchtemplate._1.StandardErrorMsg; import au.net.electronichealth.ns.tplt.xsd.interfaces.gettemplate._1.GetTemplateResponse; @@ -68,7 +68,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -77,7 +77,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -85,14 +85,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/SearchTemplateSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/template/SearchTemplateSample.java similarity index 81% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/SearchTemplateSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/template/SearchTemplateSample.java index 980f9e2..8cb47c6 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/SearchTemplateSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/template/SearchTemplateSample.java @@ -11,14 +11,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.template; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.SearchTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.template; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.template.SearchTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import au.net.electronichealth.ns.tplt.svc.searchtemplate._1.StandardErrorMsg; import au.net.electronichealth.ns.tplt.xsd.interfaces.searchtemplate._1.SearchTemplateResponse; @@ -80,7 +80,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -89,7 +89,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -97,14 +97,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetAuditViewSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetAuditViewSample.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetAuditViewSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetAuditViewSample.java index 98481f8..b75559e 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetAuditViewSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetAuditViewSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetAuditViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getauditview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getauditview._1.GetAuditViewResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getauditview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getauditview._1.GetAuditViewResponse; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -80,7 +80,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -89,7 +89,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -97,14 +97,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetChangeHistoryViewSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetChangeHistoryViewSample.java similarity index 78% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetChangeHistoryViewSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetChangeHistoryViewSample.java index 546e7d1..c1f487b 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetChangeHistoryViewSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetChangeHistoryViewSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetChangeHistoryViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getchangehistoryview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetChangeHistoryViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getchangehistoryview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -70,7 +70,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -79,7 +79,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -87,14 +87,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetDocumentListSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetDocumentListSample.java similarity index 81% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetDocumentListSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetDocumentListSample.java index 648288b..30f7b33 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetDocumentListSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetDocumentListSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import com.sun.xml.ws.developer.JAXWSProperties; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; import oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType; @@ -68,7 +68,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept queryParams.getStatuses().add(DocumentStatus.DEPRECATED); // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -77,7 +77,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -85,14 +85,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetIndividualDetailsViewSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetIndividualDetailsViewSample.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetIndividualDetailsViewSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetIndividualDetailsViewSample.java index 9289ae0..964c898 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetIndividualDetailsViewSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetIndividualDetailsViewSample.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetIndividualDetailsViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getindividualdetailsview._2.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse.Individual; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetIndividualDetailsViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getindividualdetailsview._2.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse.Individual; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -62,7 +62,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept client.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, sslSocketFactory); // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -71,7 +71,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -79,14 +79,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetRepresentativeListSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetRepresentativeListSample.java new file mode 100644 index 0000000..f9572d4 --- /dev/null +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetRepresentativeListSample.java @@ -0,0 +1,148 @@ +/* + * Copyright 2012 NEHTA + * + * Licensed under the NEHTA Open Source (Apache) License; you may not use this + * file except in compliance with the License. A copy of the License is in the + * 'LICENSE.txt' file, which should be provided with this work. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetRepresentativeListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getrepresentativelist._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; +import com.sun.xml.ws.developer.JAXWSProperties; + +import javax.net.ssl.SSLSocketFactory; +import java.io.IOException; +import java.security.GeneralSecurityException; + +/** + * An example class showing usage of the Get Representative List web service + * */ +public class GetRepresentativeListSample { + + + } + + + + public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { + + + + GetRepresentativeListClient client; + + + + // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. + SSLSocketFactory sslSocketFactory = SecurityUtil.getSsl + // ocketFactory(); + + // For testing purpos + + + + System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); + + // Ins + + lient, providing: + + + // + + ke factory; + * endpoint URI string; and + // + ging on/off. + client = new GetR + Client( + + ry, + Sec + ificate(), + + Util.getPrivateKey(), + + .GET_R + + VE _LIST, + true); + + + + + + //allow SSL connections to be set on a per client basis + + nt.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, + + + + + // Create a + g helper method. + er.User user = MessageComponents.cre + + SampleValues.USER_ID_TYPE, + SampleValues.USER_ID, + SampleVal + + Sam + ME, + + alues.USER_USE_ROLE_FOR_AUDIT + + ); + + + + // Create a sample product type, + lper method. + MHRHeader.ProductType productType = MessageComponents. + SampleValues.PRODUCT_TYPE_VENDOR, + SampleValues.PRODUCT_NAME, + SampleValues.PRODUCT_VERSION, + SampleValues.PRODUCT_PLATFORM + ); + + // Create a sample accessing organisation, using helper method. + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + SampleValues.ACCESSING_ORGANISATION_ID, + SampleValues.ACCESSING_ORGANISATION_NAME, + SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME + ); + + // Create a sample PCEHR request header, using helper method. + MHRHeader commonHeader = MessageComponents.createRequest( + user, + SampleValues.IHI_NUMBER, + productType, + SampleValues.CLIENT_SYSTEM_TYPE_CIS, + accessingOrganisation + ); + + // Call operation - get all PCEHR documents associated with given IHI. + GetRepresentativeListResponse response = client.getRepresentativeList(commonHeader); + + // Process response. + System.out.println("Response Status: " + response.getResponseStatus().getCode()); + + // Get list of documents. + GetRepresentativeListResponse.MHRRecord.RepresentativeList representativeList = response.getMHRRecord().getRepresentativeList(); + + // Get document status. + System.out.println("Representative List Size: " + representativeList.getRepresentatives().size()); + } +} diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetViewSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetViewSample.java similarity index 76% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetViewSample.java rename to src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetViewSample.java index 1eb9de4..5c3505e 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetViewSample.java +++ b/src/sample/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetViewSample.java @@ -11,28 +11,28 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TypedViewResponse; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetViewResponse.View; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.medicareoverview._1.MedicareOverview; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.observationview._1.ObservationView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TypedViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetViewResponse.View; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.medicareoverview._1.MedicareOverview; +import au.net.electronichealth.ns.mhr.xsd.interfaces.observationview._1.ObservationView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -75,7 +75,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept client.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, sslSocketFactory); // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -84,7 +84,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -92,14 +92,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/DoesPCEHRExistSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/DoesPCEHRExistSample.java deleted file mode 100644 index c079cc4..0000000 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/DoesPCEHRExistSample.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2012 NEHTA - * - * Licensed under the NEHTA Open Source (Apache) License; you may not use this - * file except in compliance with the License. A copy of the License is in the - * 'LICENSE.txt' file, which should be provided with this work. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package au.gov.nehta.vendorlibrary.pcehr.sample.recordaccess; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; - -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSocketFactory; -import java.io.IOException; -import java.security.GeneralSecurityException; - -/** - * An example class showing usage of the Does PCEHR Exist web service client. - */ -public final class DoesPCEHRExistSample { - - private DoesPCEHRExistSample() { - - } - - public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - - DoesPCEHRExistClient client; - - // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. - SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); - HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory); - - // For testing purposes. - System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); - - // Instantiate client, providing: - // - // * socket factory; - // * endpoint URI string; and - // * set logging on/off. - client = new DoesPCEHRExistClient( - sslSocketFactory, - SecurityUtil.getCertificate(), - SecurityUtil.getPrivateKey(), - SampleEndpoints.DOES_PCEHR_EXIST, - true - ); - - // Create a sample PCEHR header consisting of: - // - // * User; - // * IHI number; - // * Product type; - // * Client system type; and - // * Accessing organisation. - - // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( - SampleValues.USER_ID_TYPE, - SampleValues.USER_ID, - SampleValues.USER_ROLE, - SampleValues.USER_NAME, - SampleValues.USER_USE_ROLE_FOR_AUDIT - ); - - // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( - SampleValues.PRODUCT_TYPE_VENDOR, - SampleValues.PRODUCT_NAME, - SampleValues.PRODUCT_VERSION, - SampleValues.PRODUCT_PLATFORM - ); - - // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( - SampleValues.ACCESSING_ORGANISATION_ID, - SampleValues.ACCESSING_ORGANISATION_NAME, - SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME - ); - - // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( - user, - SampleValues.IHI_NUMBER, - productType, - SampleValues.CLIENT_SYSTEM_TYPE_CIS, - accessingOrganisation - ); - - // Call operation. - DoesPCEHRExistResponse response = client.doesPCEHRExist(commonHeader); - - // Process response. - System.out.println("PCEHR Exists: " + response.isPCEHRExists()); - System.out.println("Access Code Required: " + response.getAccessCodeRequired()); - } -} diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetRepresentativeListSample.java b/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetRepresentativeListSample.java deleted file mode 100644 index ea5bb65..0000000 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetRepresentativeListSample.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2012 NEHTA - * - * Licensed under the NEHTA Open Source (Apache) License; you may not use this - * file except in compliance with the License. A copy of the License is in the - * 'LICENSE.txt' file, which should be provided with this work. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetRepresentativeListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getrepresentativelist._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; -import com.sun.xml.ws.developer.JAXWSProperties; - -import javax.net.ssl.SSLSocketFactory; -import java.io.IOException; -import java.security.GeneralSecurityException; - -/** - * An example class showing usage of the Get Representative List web service client. - */ -public class GetRepresentativeListSample { - - private GetRepresentativeListSample() { - } - - public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - - GetRepresentativeListClient client; - - // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. - SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); - - // For testing purposes. - System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); - - // Instantiate client, providing: - // - // * socket factory; - // * endpoint URI string; and - // * set logging on/off. - client = new GetRepresentativeListClient( - sslSocketFactory, - SecurityUtil.getCertificate(), - SecurityUtil.getPrivateKey(), - SampleEndpoints.GET_REPRESENTATIVE_LIST, - true); - - - //allow SSL connections to be set on a per client basis - client.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, sslSocketFactory); - - - // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( - SampleValues.USER_ID_TYPE, - SampleValues.USER_ID, - SampleValues.USER_ROLE, - SampleValues.USER_NAME, - SampleValues.USER_USE_ROLE_FOR_AUDIT - ); - - // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( - SampleValues.PRODUCT_TYPE_VENDOR, - SampleValues.PRODUCT_NAME, - SampleValues.PRODUCT_VERSION, - SampleValues.PRODUCT_PLATFORM - ); - - // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( - SampleValues.ACCESSING_ORGANISATION_ID, - SampleValues.ACCESSING_ORGANISATION_NAME, - SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME - ); - - // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( - user, - SampleValues.IHI_NUMBER, - productType, - SampleValues.CLIENT_SYSTEM_TYPE_CIS, - accessingOrganisation - ); - - // Call operation - get all PCEHR documents associated with given IHI. - GetRepresentativeListResponse response = client.getRepresentativeList(commonHeader); - - // Process response. - System.out.println("Response Status: " + response.getResponseStatus().getCode()); - - // Get list of documents. - GetRepresentativeListResponse.PCEHRRecord.RepresentativeList representativeList = response.getPCEHRRecord().getRepresentativeList(); - - // Get document status. - System.out.println("Representative List Size: " + representativeList.getRepresentatives().size()); - } -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleEndpoints.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleEndpoints.java similarity index 97% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleEndpoints.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleEndpoints.java index 0e5f565..5db9043 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleEndpoints.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleEndpoints.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.constants; +package au.gov.nehta.vendorlibrary.mhr.sample.common.constants; /** * Sample endpoints used in sample code. These should be replaced with the appropriate, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleSecurityConstants.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleSecurityConstants.java similarity index 96% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleSecurityConstants.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleSecurityConstants.java index 1c5e686..0bd2b61 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleSecurityConstants.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleSecurityConstants.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.constants; +package au.gov.nehta.vendorlibrary.mhr.sample.common.constants; /** * Sample security constants used in sample code. These values should be replaced with valid details. diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleValues.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleValues.java similarity index 82% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleValues.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleValues.java index 46f84ee..a830255 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/constants/SampleValues.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/constants/SampleValues.java @@ -11,12 +11,12 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.constants; +package au.gov.nehta.vendorlibrary.mhr.sample.common.constants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TemplateServiceRequestorOption; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TemplateServiceRequestorOption; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; import au.net.electronichealth.ns.tplt.xsd.common.templatescoreelements._1.TemplateMetadataType; /** @@ -28,7 +28,7 @@ public final class SampleValues { /** * User - ID type. */ - public static final PCEHRHeader.User.IDType USER_ID_TYPE = PCEHRHeader.User.IDType.HPII; + public static final MHRHeader.User.IDType USER_ID_TYPE = MHRHeader.User.IDType.HPII; /** * User - ID. @@ -78,12 +78,12 @@ public final class SampleValues { /** * Client system type - CIS. */ - public static final PCEHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CIS = PCEHRHeader.ClientSystemType.CIS; + public static final MHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CIS = MHRHeader.ClientSystemType.CIS; /** * Client system type - CRP. */ - public static final PCEHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CRP = PCEHRHeader.ClientSystemType.CRP; + public static final MHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE_CRP = MHRHeader.ClientSystemType.CRP; /** * Accessing Organisation - Organisation ID. @@ -103,7 +103,7 @@ public final class SampleValues { /** * Authorisation Details - Access type. */ - public static final GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType AUTHORISATION_DETAILS_ACCESS_TYPE = GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS; + public static final GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType AUTHORISATION_DETAILS_ACCESS_TYPE = GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS; /** * Authorisation Details - Access code. diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/DocumentUtils.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/DocumentUtils.java similarity index 95% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/DocumentUtils.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/DocumentUtils.java index 5dc9fa0..b9d0be1 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/DocumentUtils.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/DocumentUtils.java @@ -1,6 +1,6 @@ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.util; +package au.gov.nehta.vendorlibrary.mhr.sample.common.util; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; import org.apache.commons.lang3.Validate; import org.w3c.dom.Document; import org.w3c.dom.NodeList; @@ -16,7 +16,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -93,3 +93,4 @@ private byte[] modifyDocId(byte[] templateContent, Holder currentId) thr return out.toByteArray(); } } + diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/MessageComponents.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/MessageComponents.java similarity index 65% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/MessageComponents.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/MessageComponents.java index 8141a13..e122749 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/MessageComponents.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/MessageComponents.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.util; +package au.gov.nehta.vendorlibrary.mhr.sample.common.util; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; /** * Helper class to create common components of a SOAP message. @@ -33,13 +33,13 @@ private MessageComponents() { * Create PCEHR record with no individual records. * * @param authorisationDetails authorisation details. - * @return populated {@link GainPCEHRAccess.PCEHRRecord} object. + * @return populated {@link GainMHRAccess.MHRRecord} object. */ - public static GainPCEHRAccess.PCEHRRecord createGainPCEHRRecord + public static GainMHRAccess.MHRRecord createGainMHRRecord ( - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails authorisationDetails + GainMHRAccess.MHRRecord.AuthorisationDetails authorisationDetails ) { - GainPCEHRAccess.PCEHRRecord record = new GainPCEHRAccess.PCEHRRecord(); + GainMHRAccess.MHRRecord record = new GainMHRAccess.MHRRecord(); record.setIndividual(null); record.setAuthorisationDetails(authorisationDetails); return record; @@ -50,37 +50,37 @@ private MessageComponents() { * * @param accessType Authorisation access type. * @param accessCode Authorisation access code. - * @return populated {@link GainPCEHRAccess.PCEHRRecord.AuthorisationDetails} object. + * @return populated {@link GainMHRAccess.MHRRecord.AuthorisationDetails} object. */ - public static GainPCEHRAccess.PCEHRRecord.AuthorisationDetails createAuthorisationDetails( - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType accessType, + public static GainMHRAccess.MHRRecord.AuthorisationDetails createAuthorisationDetails( + GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType accessType, String accessCode ) { - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails authorisationDetails = new GainPCEHRAccess.PCEHRRecord.AuthorisationDetails(); + GainMHRAccess.MHRRecord.AuthorisationDetails authorisationDetails = new GainMHRAccess.MHRRecord.AuthorisationDetails(); authorisationDetails.setAccessType(accessType); authorisationDetails.setAccessCode(accessCode); return authorisationDetails; } /** - * Create a PCEHRHeader request with custom pre-populated objects. + * Create a MHRHeader request with custom pre-populated objects. * * @param user Populated user. * @param ihiNumber IHI number. * @param productType Populated product type. * @param clientSystemType Client system type. * @param accessingOrganisation Populated accessing organisation. - * @return Populated {@link au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader} + * @return Populated {@link au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader} */ - public static PCEHRHeader createRequest( - PCEHRHeader.User user, + public static MHRHeader createRequest( + MHRHeader.User user, String ihiNumber, - PCEHRHeader.ProductType productType, - PCEHRHeader.ClientSystemType clientSystemType, - PCEHRHeader.AccessingOrganisation accessingOrganisation + MHRHeader.ProductType productType, + MHRHeader.ClientSystemType clientSystemType, + MHRHeader.AccessingOrganisation accessingOrganisation ) { // Instantiate new request header. - PCEHRHeader request = new PCEHRHeader(); + MHRHeader request = new MHRHeader(); // Populate request. request.setUser(user); @@ -101,17 +101,17 @@ public static PCEHRHeader createRequest( * @param role User role. * @param userName User name. * @param useRoleForAudit Whether or not to use user role for audit purposes. - * @return Populated {@link PCEHRHeader.User} object. + * @return Populated {@link MHRHeader.User} object. */ - public static PCEHRHeader.User createUser( - PCEHRHeader.User.IDType idType, + public static MHRHeader.User createUser( + MHRHeader.User.IDType idType, String id, String role, String userName, boolean useRoleForAudit ) { // Populate user. - PCEHRHeader.User user = new PCEHRHeader.User(); + MHRHeader.User user = new MHRHeader.User(); user.setIDType(idType); user.setID(id); user.setRole(role); @@ -127,15 +127,15 @@ public static PCEHRHeader.User createUser( * @param productName Product name. * @param productVersion Product version. * @param platform Product platform. - * @return Populated {@link PCEHRHeader.ProductType} object. + * @return Populated {@link MHRHeader.ProductType} object. */ - public static PCEHRHeader.ProductType createProductType( + public static MHRHeader.ProductType createProductType( String vendor, String productName, String productVersion, String platform ) { - PCEHRHeader.ProductType productType = new PCEHRHeader.ProductType(); + MHRHeader.ProductType productType = new MHRHeader.ProductType(); productType.setVendor(vendor); productType.setProductName(productName); productType.setProductVersion(productVersion); @@ -149,15 +149,15 @@ public static PCEHRHeader.ProductType createProductType( * @param organisationId Accessing organisation id. * @param organisationName Accessing organisation name. * @param alternateOrganisationName Access organisation alternate name. - * @return Populated {@link PCEHRHeader.AccessingOrganisation} object. + * @return Populated {@link MHRHeader.AccessingOrganisation} object. */ - public static PCEHRHeader.AccessingOrganisation createAccessingOrganisation( + public static MHRHeader.AccessingOrganisation createAccessingOrganisation( String organisationId, String organisationName, String alternateOrganisationName ) { // Populate accessing organisation. - PCEHRHeader.AccessingOrganisation accessingOrganisation = new PCEHRHeader.AccessingOrganisation(); + MHRHeader.AccessingOrganisation accessingOrganisation = new MHRHeader.AccessingOrganisation(); accessingOrganisation.setOrganisationID(organisationId); accessingOrganisation.setOrganisationName(organisationName); accessingOrganisation.setAlternateOrganisationName(alternateOrganisationName); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/SecurityUtil.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/SecurityUtil.java similarity index 96% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/SecurityUtil.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/SecurityUtil.java index 2f17997..ac53c30 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/common/util/SecurityUtil.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/common/util/SecurityUtil.java @@ -11,10 +11,10 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.common.util; +package au.gov.nehta.vendorlibrary.mhr.sample.common.util; import au.gov.nehta.vendorlibrary.common.security.KeystoreUtil; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleSecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleSecurityConstants; import javax.net.ssl.SSLSocketFactory; import java.io.IOException; diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/GetDocumentSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/GetDocumentSample.java similarity index 81% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/GetDocumentSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/GetDocumentSample.java index 073fe5c..cb9806a 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/GetDocumentSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/GetDocumentSample.java @@ -11,14 +11,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/RemoveDocumentSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/RemoveDocumentSample.java similarity index 74% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/RemoveDocumentSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/RemoveDocumentSample.java index 63ac50d..0eb7ecb 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/RemoveDocumentSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/RemoveDocumentSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -67,7 +67,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -76,7 +76,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -84,14 +84,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentMetadataSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentMetadataSample.java similarity index 75% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentMetadataSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentMetadataSample.java index cd7274f..9e92dd5 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentMetadataSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentMetadataSample.java @@ -11,19 +11,19 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentMetadataClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentMetadataClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.xml.sax.SAXException; @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentSample.java similarity index 80% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentSample.java index ec475c4..d41f3a2 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/documentexchange/UploadDocumentSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/documentexchange/UploadDocumentSample.java @@ -11,19 +11,19 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.sample.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.xml.sax.SAXException; @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/examples/CertificateVerifierUsageSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/examples/CertificateVerifierUsageSample.java similarity index 72% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/examples/CertificateVerifierUsageSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/examples/CertificateVerifierUsageSample.java index 9ae423b..58ec9a5 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/examples/CertificateVerifierUsageSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/examples/CertificateVerifierUsageSample.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.examples; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MinimalCertificateVerifier; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.examples; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MinimalCertificateVerifier; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -41,7 +41,7 @@ private CertificateVerifierUsageSample() { public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - DoesPCEHRExistClient client; + DoesMHRExistClient client; // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); @@ -55,7 +55,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * socket factory; // * endpoint URI string; and // * set logging on/off. - client = new DoesPCEHRExistClient( + client = new DoesMHRExistClient( sslSocketFactory, SecurityUtil.getCertificate(), new MinimalCertificateVerifier(), // Note: this is where an instance of the certificate verifier is supplied. @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -82,7 +82,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -90,14 +90,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, @@ -106,7 +106,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Call operation. - DoesPCEHRExistResponse response = client.doesPCEHRExist(commonHeader); + DoesMHRExistResponse response = client.doesPCEHRExist(commonHeader); // Process response. System.out.println("PCEHR Exists: " + response.isPCEHRExists()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/DoesMHRExistSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/DoesMHRExistSample.java new file mode 100644 index 0000000..7d59d7d --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/DoesMHRExistSample.java @@ -0,0 +1,107 @@ +/* + * Copyright 2012 NEHTA + * + * Licensed under the NEHTA Open Source (Apache) License; you may not use this + * file except in compliance with the License. A copy of the License is in the + * 'LICENSE.txt' file, which should be provided with this work. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package au.gov.nehta.vendorlibrary.mhr.sample.recordaccess; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSocketFactory; +import java.io.IOException; +import java.security.GeneralSecurityException; + +/** + * An example class showing usage of the Does PCEHR Exist web service client. + */ +public final class DoesMHRExistSample { + + private DoesMHRExistSample() { + + } + + public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { + + DoesMHRExistClient client; + + // Sets the newly created sslsocketfactory as the default for all instances of + // the HttpsURLConnection class. + SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); + HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory); + + // For testing purposes. + System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); + + // Instantiate client, providing: + // + // * socket factory; + // * endpoint URI string; and + // * set logging on/off. + client = new DoesMHRExistClient( + sslSocketFactory, + SecurityUtil.getCertificate(), + SecurityUtil.getPrivateKey(), + SampleEndpoints.DOES_PCEHR_EXIST, + true); + + // Create a sample PCEHR header consisting of: + // + // * User; + // * IHI number; + // * Product type; + // * Client system type; and + // * Accessing organisation. + + // Create a sample user, using helper method. + MHRHeader.User user = MessageComponents.createUser( + SampleValues.USER_ID_TYPE, + SampleValues.USER_ID, + SampleValues.USER_ROLE, + SampleValues.USER_NAME, + SampleValues.USER_USE_ROLE_FOR_AUDIT); + + // Create a sample product type, using helper method. + MHRHeader.ProductType productType = MessageComponents.createProductType( + SampleValues.PRODUCT_TYPE_VENDOR, + SampleValues.PRODUCT_NAME, + SampleValues.PRODUCT_VERSION, + SampleValues.PRODUCT_PLATFORM); + + // Create a sample accessing organisation, using helper method. + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + SampleValues.ACCESSING_ORGANISATION_ID, + SampleValues.ACCESSING_ORGANISATION_NAME, + SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME); + + // Create a sample PCEHR request header, using helper method. + MHRHeader commonHeader = MessageComponents.createRequest( + user, + SampleValues.IHI_NUMBER, + productType, + SampleValues.CLIENT_SYSTEM_TYPE_CIS, + accessingOrganisation); + + // Call operation. + DoesMHRExistResponse response = client.doesPCEHRExist(commonHeader); + + // Process response. + System.out.println("PCEHR Exists: " + response.isPCEHRExists()); + System.out.println("Access Code Required: " + response.getAccessCodeRequired()); + } +} diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/GainPCEHRAccessSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/GainMHRAccessSample.java similarity index 67% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/GainPCEHRAccessSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/GainMHRAccessSample.java index ee5bba5..e7b9ba7 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/GainPCEHRAccessSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/recordaccess/GainMHRAccessSample.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.recordaccess; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.GainPCEHRAccessClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccessResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.recordaccess; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccessResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -31,15 +31,15 @@ /** * An example class showing usage of the Gain PCEHR Access web service client. */ -public final class GainPCEHRAccessSample { +public final class GainMHRAccessSample { - private GainPCEHRAccessSample() { + private GainMHRAccessSample() { } public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - GainPCEHRAccessClient client; + GainMHRAccessClient client; // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); @@ -53,7 +53,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * socket factory; // * endpoint URI string; and // * set logging on/off. - client = new GainPCEHRAccessClient( + client = new GainMHRAccessClient( sslSocketFactory, SecurityUtil.getCertificate(), SecurityUtil.getPrivateKey(), @@ -66,13 +66,13 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // Create a sample authorisation details, using helper method. // // Note: For this example, EmergencyAccess type is used so code is not required (ie. null). - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails authorisationDetails = MessageComponents.createAuthorisationDetails( + GainMHRAccess.MHRRecord.AuthorisationDetails authorisationDetails = MessageComponents.createAuthorisationDetails( SampleValues.AUTHORISATION_DETAILS_ACCESS_TYPE, SampleValues.AUTHORISATION_DETAILS_ACCESS_CODE ); // Create a sample PCEHR record, using helper method. - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(authorisationDetails); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(authorisationDetails); // Create a sample PCEHR header consisting of: // @@ -83,7 +83,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -92,7 +92,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -100,14 +100,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, @@ -116,7 +116,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Call operation. - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, commonHeader); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, commonHeader); // Process response. System.out.println("Individual IHI : " + response.getIndividual().getIhiNumber()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/registration/RegisterPCEHRSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/registration/RegisterMHRSample.java similarity index 67% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/registration/RegisterPCEHRSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/registration/RegisterMHRSample.java index b9f498a..9aeb07b 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/registration/RegisterPCEHRSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/registration/RegisterMHRSample.java @@ -11,31 +11,31 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.registration; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentConsentCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.EvidenceOfIdentityCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IVCCorrespondeceChannelCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IndigenousStatusCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.registration.RegisterPCEHRClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.ContactDetailsType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.NameTypeSupp; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Sex; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Representative; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.DocumentConsent; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.IvcCorrespondence; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.DocumentConsent.Document; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity.EvidenceOfIdentity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHRResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.registration; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentConsentCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.EvidenceOfIdentityCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IVCCorrespondeceChannelCode; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IndigenousStatusCode; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.registration.RegisterMHRClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.ContactDetailsType; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.NameTypeSupp; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Sex; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Representative; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.DocumentConsent; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.IvcCorrespondence; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.DocumentConsent.Document; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity.EvidenceOfIdentity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHRResponse; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; @@ -51,17 +51,17 @@ /** * An example class showing usage of the Register PCEHR web service client. */ -public class RegisterPCEHRSample { +public class RegisterMHRSample { - private RegisterPCEHRSample() { + private RegisterMHRSample() { } public static void main(String[] args) throws IOException, GeneralSecurityException, - au.net.electronichealth.ns.pcehr.svc.registerpcehr._2.StandardErrorMsg { + au.net.electronichealth.ns.mhr.svc.registermhr._2.StandardErrorMsg { - RegisterPCEHRClient client; + RegisterMHRClient client; // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); @@ -75,7 +75,7 @@ public static void main(String[] args) throws // * socket factory; // * endpoint URI string; and // * set logging on/off. - client = new RegisterPCEHRClient( + client = new RegisterMHRClient( sslSocketFactory, SecurityUtil.getCertificate(), SecurityUtil.getPrivateKey(), @@ -92,7 +92,7 @@ public static void main(String[] args) throws // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -101,7 +101,7 @@ public static void main(String[] args) throws ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -109,14 +109,14 @@ public static void main(String[] args) throws ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, @@ -127,7 +127,7 @@ public static void main(String[] args) throws /** * In terms of the information required to register a PCEHR, there are two distinct options: * - * 1. An IHI is provided in the PCEHRHeader (or in the child IHI, if registering a child for a PCEHR). + * 1. An IHI is provided in the MHRHeader (or in the child IHI, if registering a child for a PCEHR). * 2. Demographic information in instances where the IHI is not specified (or in the child demographics, * if registering a child for a PCEHR). * @@ -136,13 +136,13 @@ public static void main(String[] args) throws */ // Register PCEHR - child w/IHI. - RegisterPCEHR registrationDetails = generateChildWithIHI(); + RegisterMHR registrationDetails = generateChildWithIHI(); // Register PCEHR - person w/demographics. - // ** Uncomment ** RegisterPCEHR registrationDetails = generatePersonWithDemographics(); + // ** Uncomment ** RegisterMHR registrationDetails = generatePersonWithDemographics(); // Call operation. - RegisterPCEHRResponse response = client.registerPCEHR(commonHeader, registrationDetails); + RegisterMHRResponse response = client.registerPCEHR(commonHeader, registrationDetails); // Process response. System.out.println("Registration Status: " + response.getResponseStatus().getCode()); @@ -151,13 +151,13 @@ public static void main(String[] args) throws /** * Generate the registration for a child. * - * @return Populated {@link RegisterPCEHR} + * @return Populated {@link RegisterMHR} */ - private static RegisterPCEHR generateChildWithIHI() { + private static RegisterMHR generateChildWithIHI() { - RegisterPCEHR registrationDetails = new RegisterPCEHR(); + RegisterMHR registrationDetails = new RegisterMHR(); - RegisterPCEHR.Assertions assertions = new RegisterPCEHR.Assertions(); + RegisterMHR.Assertions assertions = new RegisterMHR.Assertions(); // Note the need to define this registration request as a parent on behalf of their child. @@ -194,7 +194,7 @@ private static RegisterPCEHR generateChildWithIHI() { /** * Populate a new child. */ - //RegisterPCEHR.Child child = new RegisterPCEHR.Child(); + //RegisterMHR.Child child = new RegisterMHR.Child(); // child.setIhiNumber(""); registrationDetails.setAssertions(assertions); @@ -206,13 +206,13 @@ private static RegisterPCEHR generateChildWithIHI() { /** * Generate the registration for a person. * - * @return Populated {@link RegisterPCEHR} + * @return Populated {@link RegisterMHR} */ - private static RegisterPCEHR generatePersonWithDemographics() { + private static RegisterMHR generatePersonWithDemographics() { - RegisterPCEHR registrationDetails = new RegisterPCEHR(); + RegisterMHR registrationDetails = new RegisterMHR(); - RegisterPCEHR.Assertions assertions = new RegisterPCEHR.Assertions(); + RegisterMHR.Assertions assertions = new RegisterMHR.Assertions(); assertions.setAcceptedTermsAndConditions( true ); @@ -252,9 +252,9 @@ private static RegisterPCEHR generatePersonWithDemographics() { /** * Populate a new individual. */ - RegisterPCEHR.Individual individual = new RegisterPCEHR.Individual(); + RegisterMHR.Individual individual = new RegisterMHR.Individual(); - RegisterPCEHR.Individual.Demographics demographics = new RegisterPCEHR.Individual.Demographics(); + RegisterMHR.Individual.Demographics demographics = new RegisterMHR.Individual.Demographics(); // Populate the individual's name. NameTypeSupp name = new NameTypeSupp(); @@ -273,7 +273,7 @@ private static RegisterPCEHR generatePersonWithDemographics() { //If a Representative exists Representative representative = new Representative(); - RegisterPCEHR.Representative.Demographics repDemographics = new RegisterPCEHR.Representative.Demographics(); + RegisterMHR.Representative.Demographics repDemographics = new RegisterMHR.Representative.Demographics(); // Populate the representative's name. NameTypeSupp repName = new NameTypeSupp(); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/GetTemplateSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/template/GetTemplateSample.java similarity index 80% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/GetTemplateSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/template/GetTemplateSample.java index 1bd90fe..7efe62b 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/GetTemplateSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/template/GetTemplateSample.java @@ -11,14 +11,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.template; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.GetTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.template; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.template.GetTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import au.net.electronichealth.ns.tplt.svc.searchtemplate._1.StandardErrorMsg; import au.net.electronichealth.ns.tplt.xsd.interfaces.gettemplate._1.GetTemplateResponse; @@ -68,7 +68,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -77,7 +77,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -85,14 +85,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/SearchTemplateSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/template/SearchTemplateSample.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/SearchTemplateSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/template/SearchTemplateSample.java index 980f9e2..8cb47c6 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/template/SearchTemplateSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/template/SearchTemplateSample.java @@ -11,14 +11,14 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.template; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.SearchTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.template; + +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.template.SearchTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import au.net.electronichealth.ns.tplt.svc.searchtemplate._1.StandardErrorMsg; import au.net.electronichealth.ns.tplt.xsd.interfaces.searchtemplate._1.SearchTemplateResponse; @@ -80,7 +80,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -89,7 +89,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -97,14 +97,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetAuditViewSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetAuditViewSample.java similarity index 81% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetAuditViewSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetAuditViewSample.java index 98481f8..b75559e 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetAuditViewSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetAuditViewSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetAuditViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getauditview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getauditview._1.GetAuditViewResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getauditview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getauditview._1.GetAuditViewResponse; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -80,7 +80,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -89,7 +89,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -97,14 +97,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetChangeHistoryViewSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetChangeHistoryViewSample.java similarity index 78% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetChangeHistoryViewSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetChangeHistoryViewSample.java index 546e7d1..c1f487b 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetChangeHistoryViewSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetChangeHistoryViewSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetChangeHistoryViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getchangehistoryview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetChangeHistoryViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getchangehistoryview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -70,7 +70,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept // * Accessing organisation. // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -79,7 +79,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -87,14 +87,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetDocumentListSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetDocumentListSample.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetDocumentListSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetDocumentListSample.java index 648288b..30f7b33 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetDocumentListSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetDocumentListSample.java @@ -11,16 +11,16 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import com.sun.xml.ws.developer.JAXWSProperties; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; import oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType; @@ -68,7 +68,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept queryParams.getStatuses().add(DocumentStatus.DEPRECATED); // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -77,7 +77,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -85,14 +85,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetIndividualDetailsViewSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetIndividualDetailsViewSample.java similarity index 74% rename from src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetIndividualDetailsViewSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetIndividualDetailsViewSample.java index 9289ae0..964c898 100644 --- a/src/sample/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetIndividualDetailsViewSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetIndividualDetailsViewSample.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetIndividualDetailsViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getindividualdetailsview._2.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse.Individual; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetIndividualDetailsViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getindividualdetailsview._2.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getindividualdetailsview._2.GetIndividualDetailsViewResponse.Individual; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -62,7 +62,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept client.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, sslSocketFactory); // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -71,7 +71,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -79,14 +79,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetRepresentativeListSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetRepresentativeListSample.java new file mode 100644 index 0000000..cedd385 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetRepresentativeListSample.java @@ -0,0 +1,107 @@ +/* + * Copyright 2012 NEHTA + * + * Licensed under the NEHTA Open Source (Apache) License; you may not use this + * file except in compliance with the License. A copy of the License is in the + * 'LICENSE.txt' file, which should be provided with this work. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetRepresentativeListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getrepresentativelist._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; +import com.sun.xml.ws.developer.JAXWSProperties; + +import javax.net.ssl.SSLSocketFactory; +import java.io.IOException; +import java.security.GeneralSecurityException; + +/** + * An example class showing usage of the Get Representative List web service + * client. + */ +public class GetRepresentativeListSample { + + private GetRepresentativeListSample() { + } + + public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { + + GetRepresentativeListClient client; + + // Sets the newly created sslsocketfactory as the default for all instances of + // the HttpsURLConnection class. + SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); + + // For testing purposes. + System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); + + // Instantiate client, providing: + // + // * socket factory; + // * endpoint URI string; and + // * set logging on/off. + client = new GetRepresentativeListClient( + sslSocketFactory, + SecurityUtil.getCertificate(), + SecurityUtil.getPrivateKey(), + SampleEndpoints.GET_REPRESENTATIVE_LIST, + true); + + // allow SSL connections to be set on a per client basis + client.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, sslSocketFactory); + + // Create a sample user, using helper method. + MHRHeader.User user = MessageComponents.createUser( + SampleValues.USER_ID_TYPE, + SampleValues.USER_ID, + SampleValues.USER_ROLE, + SampleValues.USER_NAME, + SampleValues.USER_USE_ROLE_FOR_AUDIT); + + // Create a sample product type, using helper method. + MHRHeader.ProductType productType = MessageComponents.createProductType( + SampleValues.PRODUCT_TYPE_VENDOR, + SampleValues.PRODUCT_NAME, + SampleValues.PRODUCT_VERSION, + SampleValues.PRODUCT_PLATFORM); + + // Create a sample accessing organisation, using helper method. + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + SampleValues.ACCESSING_ORGANISATION_ID, + SampleValues.ACCESSING_ORGANISATION_NAME, + SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME); + + // Create a sample PCEHR request header, using helper method. + MHRHeader commonHeader = MessageComponents.createRequest( + user, + SampleValues.IHI_NUMBER, + productType, + SampleValues.CLIENT_SYSTEM_TYPE_CIS, + accessingOrganisation); + + // Call operation - get all PCEHR documents associated with given IHI. + GetRepresentativeListResponse response = client.getRepresentativeList(commonHeader); + + // Process response. + System.out.println("Response Status: " + response.getResponseStatus().getCode()); + + // Get list of documents. + GetRepresentativeListResponse.MHRRecord.RepresentativeList representativeList = response.getMHRRecord() + .getRepresentativeList(); + + // Get document status. + System.out.println("Representative List Size: " + representativeList.getRepresentatives().size()); + } +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetViewSample.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetViewSample.java similarity index 76% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetViewSample.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetViewSample.java index e64f99c..2678fb2 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetViewSample.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/sample/view/GetViewSample.java @@ -11,28 +11,28 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TypedViewResponse; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetViewResponse.View; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.medicareoverview._1.MedicareOverview; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.observationview._1.ObservationView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; +package au.gov.nehta.vendorlibrary.mhr.sample.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TypedViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleEndpoints; +import au.gov.nehta.vendorlibrary.mhr.sample.common.constants.SampleValues; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetViewResponse.View; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.medicareoverview._1.MedicareOverview; +import au.net.electronichealth.ns.mhr.xsd.interfaces.observationview._1.ObservationView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; import com.sun.xml.ws.developer.JAXWSProperties; import javax.net.ssl.SSLSocketFactory; @@ -75,7 +75,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept client.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, sslSocketFactory); // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( + MHRHeader.User user = MessageComponents.createUser( SampleValues.USER_ID_TYPE, SampleValues.USER_ID, SampleValues.USER_ROLE, @@ -84,7 +84,7 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( + MHRHeader.ProductType productType = MessageComponents.createProductType( SampleValues.PRODUCT_TYPE_VENDOR, SampleValues.PRODUCT_NAME, SampleValues.PRODUCT_VERSION, @@ -92,14 +92,14 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept ); // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( + MHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( SampleValues.ACCESSING_ORGANISATION_ID, SampleValues.ACCESSING_ORGANISATION_NAME, SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME ); // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( + MHRHeader commonHeader = MessageComponents.createRequest( user, SampleValues.IHI_NUMBER, productType, diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/AllTests.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/AllTests.java similarity index 82% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/AllTests.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/AllTests.java index c8b49b4..0d5f349 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/AllTests.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/AllTests.java @@ -12,12 +12,12 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -35,7 +35,7 @@ public class AllTests { private static SSLSocketFactory sslSocketFactory; private static X509Certificate certificate; private static PrivateKey privateKey; - private static PCEHRHeader defaultRequest; + private static MHRHeader defaultRequest; @BeforeClass public static void setUp() throws Exception { @@ -49,10 +49,10 @@ public boolean verify(String s, SSLSession sslSession) { ); defaultRequest = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "ROSS JOHN", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "ROSS JOHN", false), "8003602345689155", MessageComponents.createProductType("NEHTA", "Test Harness", "1.0", "Windows XP"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "2", null) ); @@ -82,7 +82,7 @@ public static void tearDown() { privateKey = null; } - public static PCEHRHeader getDefaultRequest() { + public static MHRHeader getDefaultRequest() { return defaultRequest; } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/DocumentExchangeSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/DocumentExchangeSuite.java new file mode 100644 index 0000000..fe573ec --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/DocumentExchangeSuite.java @@ -0,0 +1,20 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.suites; + + +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange.GetDocumentTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange.RemoveDocumentTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange.UploadDocumentClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange.UploadDocumentMetadataClientTest; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + UploadDocumentClientTest.class, + UploadDocumentMetadataClientTest.class, + RemoveDocumentTest.class, + GetDocumentTest.class +}) + +public class DocumentExchangeSuite { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/RecordAccessSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/RecordAccessSuite.java new file mode 100644 index 0000000..4ecb982 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/RecordAccessSuite.java @@ -0,0 +1,15 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.suites; + +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.recordaccess.DoesPCHERExistClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.recordaccess.GainMHRAccessClientTest; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GainMHRAccessClientTest.class, + DoesPCHERExistClientTest.class +}) + +public class RecordAccessSuite { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/RegisterSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/RegisterSuite.java similarity index 76% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/RegisterSuite.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/RegisterSuite.java index fa4a29e..44edadb 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/RegisterSuite.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/RegisterSuite.java @@ -12,15 +12,15 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.suites; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.suites; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.registration.RegisterPCEHRClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.registration.RegisterMHRClientTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ - RegisterPCEHRClientTest.class + RegisterMHRClientTest.class }) public class RegisterSuite { diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/TemplateSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/TemplateSuite.java similarity index 73% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/TemplateSuite.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/TemplateSuite.java index 0515d9e..58f3354 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/TemplateSuite.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/TemplateSuite.java @@ -12,10 +12,10 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.suites; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.suites; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.template.GetTemplateClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.template.SearchTemplateClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.template.GetTemplateClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.template.SearchTemplateClientTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/TestSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/TestSuite.java similarity index 79% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/TestSuite.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/TestSuite.java index a962d9d..fb1d614 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/TestSuite.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/TestSuite.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.suites; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.suites; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/ViewSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/ViewSuite.java new file mode 100644 index 0000000..b71d2ec --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/suites/ViewSuite.java @@ -0,0 +1,20 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.suites; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view.GetAuditViewClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view.GetChangeHistoryViewClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view.GetDocumentListClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view.GetRepresentativeListClientTest; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GetDocumentListClientTest.class, + GetAuditViewClientTest.class, + GetChangeHistoryViewClientTest.class, + GetRepresentativeListClientTest.class +}) + +public class ViewSuite { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/GetDocumentTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/GetDocumentTest.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/GetDocumentTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/GetDocumentTest.java index a1fba8e..a27b024 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/GetDocumentTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/GetDocumentTest.java @@ -1,10 +1,10 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; import org.junit.After; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/RemoveDocumentTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/RemoveDocumentTest.java similarity index 70% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/RemoveDocumentTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/RemoveDocumentTest.java index c58d735..537706e 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/RemoveDocumentTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/RemoveDocumentTest.java @@ -1,11 +1,11 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import org.junit.Assert; import org.junit.After; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/UploadDocumentClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/UploadDocumentClientTest.java similarity index 80% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/UploadDocumentClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/UploadDocumentClientTest.java index 9fd3a11..714d532 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/UploadDocumentClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/UploadDocumentClientTest.java @@ -1,25 +1,25 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.junit.*; import org.w3c.dom.Document; @@ -33,7 +33,7 @@ import javax.xml.transform.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -176,7 +176,7 @@ private static SubmissionSet createPackage(final byte[] rootDocument, X509Certif return subsetBuilder.build(); } - private static RemoveDocumentResponse removeDoc(PCEHRHeader commonHeader, String docId, SSLSocketFactory sslSocketFactory) throws GeneralSecurityException, StandardErrorMsg { + private static RemoveDocumentResponse removeDoc(MHRHeader commonHeader, String docId, SSLSocketFactory sslSocketFactory) throws GeneralSecurityException, StandardErrorMsg { RemoveDocumentClient removeClient = new RemoveDocumentClient( sslSocketFactory, SecurityUtil.getCertificate(), @@ -188,3 +188,4 @@ private static RemoveDocumentResponse removeDoc(PCEHRHeader commonHeader, String return removeClient.removeDocument(commonHeader, docId, RemoveDocument.DocumentRemovalReason.WITHDRAWN); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/UploadDocumentMetadataClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/UploadDocumentMetadataClientTest.java similarity index 65% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/UploadDocumentMetadataClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/UploadDocumentMetadataClientTest.java index 7245e61..5ce98b3 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/documentexchange/UploadDocumentMetadataClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/documentexchange/UploadDocumentMetadataClientTest.java @@ -1,14 +1,14 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentMetadataClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentMetadataClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.junit.After; import org.junit.Assert; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/recordaccess/DoesPCHERExistClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/recordaccess/DoesPCHERExistClientTest.java similarity index 77% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/recordaccess/DoesPCHERExistClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/recordaccess/DoesPCHERExistClientTest.java index c4de3a6..d1e4893 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/recordaccess/DoesPCHERExistClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/recordaccess/DoesPCHERExistClientTest.java @@ -11,35 +11,35 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.recordaccess; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import javax.xml.namespace.QName; -import javax.xml.ws.BindingProvider; -import javax.xml.ws.handler.Handler; -import javax.xml.ws.handler.MessageContext; -import javax.xml.ws.handler.soap.SOAPHandler; -import javax.xml.ws.handler.soap.SOAPMessageContext; +import jakarta.xml.ws.BindingProvider; +import jakarta.xml.ws.handler.Handler; +import jakarta.xml.ws.handler.MessageContext; +import jakarta.xml.ws.handler.soap.SOAPHandler; +import jakarta.xml.ws.handler.soap.SOAPMessageContext; import java.util.List; import java.util.Set; import java.util.logging.Logger; public class DoesPCHERExistClientTest { private static final Logger log = Logger.getLogger("test"); - private DoesPCEHRExistClient client; + private DoesMHRExistClient client; @Before public final void setUp() throws Exception { AllTests.setUp(); - client = new DoesPCEHRExistClient( + client = new DoesMHRExistClient( AllTests.getSslSocketFactory(), AllTests.getCertificate(), @@ -94,7 +94,7 @@ public Set getHeaders() { System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true"); try { - DoesPCEHRExistResponse doesPCEHRExist = client.doesPCEHRExist(AllTests.getDefaultRequest()); + DoesMHRExistResponse doesPCEHRExist = client.doesPCEHRExist(AllTests.getDefaultRequest()); System.out.println(doesPCEHRExist.isPCEHRExists()); } catch (StandardErrorMsg e) { System.out.println(e.getFaultInfo().getMessage()); @@ -116,7 +116,7 @@ public void test_SocketTimeout() throws StandardErrorMsg { //connect timeouts client.setProperty("com.sun.xml.internal.ws.connect.timeout", 2000); client.setProperty("com.sun.xml.ws.connect.timeout", 2000); - DoesPCEHRExistResponse doesPCEHRExist = client.doesPCEHRExist(AllTests.getDefaultRequest()); + DoesMHRExistResponse doesPCEHRExist = client.doesPCEHRExist(AllTests.getDefaultRequest()); System.out.println(doesPCEHRExist.isPCEHRExists()); @@ -133,8 +133,9 @@ public void test_030() throws Exception { // String s =(String) requestContext.get( BindingProvider.ENDPOINT_ADDRESS_PROPERTY); // System.out.println("endpoint:"+s); - DoesPCEHRExistResponse response = client.doesPCEHRExist(AllTests.getDefaultRequest()); + DoesMHRExistResponse response = client.doesPCEHRExist(AllTests.getDefaultRequest()); Assert.assertTrue(response.isPCEHRExists()); - Assert.assertEquals(DoesPCEHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); + Assert.assertEquals(DoesMHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/recordaccess/GainPCEHRAccessClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/recordaccess/GainMHRAccessClientTest.java similarity index 63% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/recordaccess/GainPCEHRAccessClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/recordaccess/GainMHRAccessClientTest.java index 1ad0058..c255674 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/recordaccess/GainPCEHRAccessClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/recordaccess/GainMHRAccessClientTest.java @@ -11,26 +11,26 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.recordaccess; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.GainPCEHRAccessClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccessResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccessResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -public class GainPCEHRAccessClientTest { +public class GainMHRAccessClientTest { - private GainPCEHRAccessClient client; + private GainMHRAccessClient client; @Before public final void setUp() throws Exception { AllTests.setUp(); - client = new GainPCEHRAccessClient( + client = new GainMHRAccessClient( AllTests.getSslSocketFactory(), AllTests.getCertificate(), AllTests.getPrivateKey(), @@ -47,8 +47,8 @@ public final void tearDown() throws Exception { @Test public void test_020() throws Exception { - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, AllTests.getDefaultRequest()); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, AllTests.getDefaultRequest()); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); Assert.assertEquals("SUCCESS", response.getResponseStatus().getDescription()); Assert.assertEquals("8003601008083417", response.getIndividual().getIhiNumber()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/registration/RegisterPCEHRClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/registration/RegisterMHRClientTest.java similarity index 54% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/registration/RegisterPCEHRClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/registration/RegisterMHRClientTest.java index bfc7449..b2b7cf0 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/registration/RegisterPCEHRClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/registration/RegisterMHRClientTest.java @@ -1,30 +1,30 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.registration; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.registration; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IVCCorrespondeceChannelCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IndigenousStatusCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.registration.RegisterPCEHRClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.ContactDetailsType; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity.EvidenceOfIdentity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.IvcCorrespondence; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHRResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IVCCorrespondeceChannelCode; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IndigenousStatusCode; +import au.gov.nehta.vendorlibrary.mhr.clients.registration.RegisterMHRClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.ContactDetailsType; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity.EvidenceOfIdentity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.IvcCorrespondence; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHRResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -public class RegisterPCEHRClientTest { +public class RegisterMHRClientTest { - private RegisterPCEHRClient client; + private RegisterMHRClient client; @Before public final void setUp() throws Exception { AllTests.setUp(); - client = new RegisterPCEHRClient( + client = new RegisterMHRClient( AllTests.getSslSocketFactory(), AllTests.getCertificate(), AllTests.getPrivateKey(), @@ -44,8 +44,8 @@ public final void tearDown() throws Exception { public void test_010() throws Exception { // This test registers a PCEHR with an IHI. - RegisterPCEHR registrationDetails = new RegisterPCEHR(); - RegisterPCEHR.Assertions assertions = new RegisterPCEHR.Assertions(); + RegisterMHR registrationDetails = new RegisterMHR(); + RegisterMHR.Assertions assertions = new RegisterMHR.Assertions(); IvcCorrespondence ivc = new IvcCorrespondence(); ivc.setChannel(IVCCorrespondeceChannelCode.email.getCode()); ContactDetailsType details = new ContactDetailsType(); @@ -68,7 +68,7 @@ public void test_010() throws Exception { //TODO:this registrationDetails.setAssertions(assertions); - RegisterPCEHRResponse response = client.registerPCEHR(AllTests.getDefaultRequest(), registrationDetails); + RegisterMHRResponse response = client.registerPCEHR(AllTests.getDefaultRequest(), registrationDetails); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); } } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/template/GetTemplateClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/template/GetTemplateClientTest.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/template/GetTemplateClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/template/GetTemplateClientTest.java index b18439b..680f32b 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/template/GetTemplateClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/template/GetTemplateClientTest.java @@ -1,10 +1,10 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.template; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.template; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TemplateServiceRequestorOption; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.GetTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TemplateServiceRequestorOption; +import au.gov.nehta.vendorlibrary.mhr.clients.template.GetTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import au.net.electronichealth.ns.tplt.xsd.interfaces.gettemplate._1.GetTemplateResponse; import org.junit.Assert; import org.junit.After; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/template/SearchTemplateClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/template/SearchTemplateClientTest.java similarity index 84% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/template/SearchTemplateClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/template/SearchTemplateClientTest.java index d7a17c4..cad9a9a 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/template/SearchTemplateClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/template/SearchTemplateClientTest.java @@ -1,9 +1,9 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.template; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.template; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.SearchTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.template.SearchTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import au.net.electronichealth.ns.tplt.xsd.common.templatescoreelements._1.TemplateMetadataType; import au.net.electronichealth.ns.tplt.xsd.interfaces.searchtemplate._1.SearchTemplateResponse; import org.junit.Assert; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetAuditViewClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetAuditViewClientTest.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetAuditViewClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetAuditViewClientTest.java index 6292972..54af686 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetAuditViewClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetAuditViewClientTest.java @@ -1,10 +1,10 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetAuditViewClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getauditview._1.GetAuditViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getauditview._1.GetAuditViewResponse; import org.junit.Assert; import org.junit.After; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetChangeHistoryViewClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetChangeHistoryViewClientTest.java similarity index 66% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetChangeHistoryViewClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetChangeHistoryViewClientTest.java index 1d52d82..c9ce842 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetChangeHistoryViewClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetChangeHistoryViewClientTest.java @@ -1,11 +1,11 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetChangeHistoryViewClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetChangeHistoryViewClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetDocumentListClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetDocumentListClientTest.java similarity index 91% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetDocumentListClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetDocumentListClientTest.java index 091d2ae..ccd8b6c 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetDocumentListClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetDocumentListClientTest.java @@ -11,27 +11,27 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.*; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.*; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; import oasis.names.tc.ebxml_regrep.xsd.rim._3.*; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryError; import org.junit.*; -import javax.xml.bind.JAXBElement; +import jakarta.xml.bind.JAXBElement; import java.util.Date; import java.util.List; /** - * Test cases for the {@link au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient} class. + * Test cases for the {@link au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient} class. */ public class GetDocumentListClientTest { @@ -64,12 +64,12 @@ public void test_Approved() throws Exception { queryParams.getStatuses().add(DocumentStatus.APPROVED); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation(/*"8003620833337558 "8003628233352432"*/ "8003628233352432", "Medicare305", null) ); @@ -90,12 +90,12 @@ public void test_getMetaData() throws Exception { queryParams.getStatuses().add(DocumentStatus.DELETED); // queryParams.setDocumentCreationTimeFrom("20130501000000"); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003601243017691", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -147,12 +147,12 @@ public void test_080() throws Exception { // queryParams.setServiceStartTimeTo( "" ); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation(/*"8003620833337558"*/ "8003628233352432", "Medicare305", null) ); @@ -174,7 +174,7 @@ public void test_ServiceStartTime() throws Exception { queryParams.setServiceStartTimeTo("20130729000000"); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -204,7 +204,7 @@ public void test_ServiceStartTimeNoEnd() throws Exception { //queryParams.setServiceStartTimeTo( "20130729000000" ); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -234,7 +234,7 @@ public void test_ServiceStartTimeNoBegin() throws Exception { queryParams.setServiceStartTimeTo("20130729000000"); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -265,7 +265,7 @@ public void test_DocumentCreationTime() throws Exception { queryParams.setDocumentCreationTimeTo("20130729000000"); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -295,7 +295,7 @@ public void test_DocumentCreationTimeNoEnd() throws Exception { // queryParams.setDocumentCreationTimeTo( "20130729000000" ); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -326,7 +326,7 @@ public void test_DocumentCreationTimeNoBegin() throws Exception { queryParams.setDocumentCreationTimeTo("20130729000000"); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -357,7 +357,7 @@ public void test_ServiceStopTime() throws Exception { queryParams.setServiceStopTimeTo("20130729000000"); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -387,7 +387,7 @@ public void test_ServiceStopTimeNoEnd() throws Exception { //queryParams.setServiceStopTimeTo( "20130729000000" ); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -416,7 +416,7 @@ public void test_MultipleStatus() throws Exception { queryParams.getStatuses().add(DocumentStatus.DELETED); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -446,7 +446,7 @@ public void test_FormatCodes() throws Exception { queryParams.getTemplateIds().add(FormatCodes.PCEHR_PRESCRIPTION.getCodedValue()); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -476,7 +476,7 @@ public void test_MultipleFormatCodes() throws Exception { queryParams.getTemplateIds().add(FormatCodes.EVENT_SUMMARY_3A.getCodedValue()); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -508,7 +508,7 @@ public void test_ClinicalSpecialty_PracticeSettingCode() throws Exception { queryParams.getClinicalSpecialties().add(PracticeSettingTypeCodes.HOSPITAL.getCodedValue()); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -540,7 +540,7 @@ public void test_Keywords_EntryEventCode() throws Exception { queryParams.getKeywords().add("Event"); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -571,7 +571,7 @@ public void test_AuthorIndividual_AuthorPerson() throws Exception { queryParams.getAuthorIndividuals().add(new Author("Black", "Ely", "Dr", "8003618334357646")); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -602,7 +602,7 @@ public void test_AuthorIndividual_AuthorPerson_WildCards() throws Exception { queryParams.getAuthorIndividuals().add(new Author("%", "%", "%", "%1")); //queryParams.getAuthorIndividuals().add( new Author("%ck","_ly","%r","8003618334357646") ); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -633,7 +633,7 @@ public void test_DocumentClasses() throws Exception { queryParams.getDocumentClasses().add(new CodedValue("MADE_UP", "1.2.3.4.5.6.7.8.9")); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -666,7 +666,7 @@ public void test_muliple_DocumentClasses() throws Exception { queryParams.getDocumentClasses().add(new CodedValue("MADE_UP", "2.2.3.4.5.6.7.8.9")); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -698,7 +698,7 @@ public void test_multiple_AuthorIndividual_AuthorPerson() throws Exception { queryParams.getAuthorIndividuals().add(new Author("Doe", "Jane", null, null)); - PCEHRHeader request = getKnownIHIHeader(); + MHRHeader request = getKnownIHIHeader(); AdhocQueryResponse response = client.getDocumentList(request, queryParams); @@ -732,13 +732,13 @@ public void test_multiple_AuthorIndividual_AuthorPerson() throws Exception { * * @return The header */ - public PCEHRHeader getKnownIHIHeader() { - PCEHRHeader request = MessageComponents.createRequest + public MHRHeader getKnownIHIHeader() { + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606789133695", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation(/*"8003620833337558"*/ "8003628233352432", "Medicare305", null) ); return request; @@ -797,3 +797,4 @@ public void debugOut(AdhocQueryResponse response) { } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetRepresentativeListClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetRepresentativeListClientTest.java similarity index 77% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetRepresentativeListClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetRepresentativeListClientTest.java index 4ed7b31..1cd2c02 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/tests/view/GetRepresentativeListClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120718_regression/tests/view/GetRepresentativeListClientTest.java @@ -12,13 +12,13 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.tests.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetRepresentativeListClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetRepresentativeListClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/DocumentExchangeSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/DocumentExchangeSuite_NOC.java new file mode 100644 index 0000000..03a9e94 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/DocumentExchangeSuite_NOC.java @@ -0,0 +1,21 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.suites; + +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange.GeneralTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange.GetDocumentTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange.RemoveDocumentTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange.UploadDocumentMetadataClient_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange.UploadDocumentClientTest_NOC; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + UploadDocumentClientTest_NOC.class, + GetDocumentTest_NOC.class, + RemoveDocumentTest_NOC.class, + UploadDocumentMetadataClient_NOC.class, + GeneralTest_NOC.class +}) + +public class DocumentExchangeSuite_NOC { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/NOCTestSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/NOCTestSuite.java similarity index 79% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/NOCTestSuite.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/NOCTestSuite.java index a71567b..6a13390 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/NOCTestSuite.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/NOCTestSuite.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.suites; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.suites; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/RecordAccessSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/RecordAccessSuite_NOC.java new file mode 100644 index 0000000..8777d7e --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/RecordAccessSuite_NOC.java @@ -0,0 +1,18 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.suites; + +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.recordaccess.AllRecordAccessTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.recordaccess.DoesPCHERExistClientTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.recordaccess.GainMHRAccessClientTest_NOC; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + DoesPCHERExistClientTest_NOC.class, + GainMHRAccessClientTest_NOC.class, + AllRecordAccessTest_NOC.class +}) + +public class RecordAccessSuite_NOC { + +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/TemplateSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/TemplateSuite_NOC.java new file mode 100644 index 0000000..8186bc3 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/TemplateSuite_NOC.java @@ -0,0 +1,16 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.suites; + +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.template.GetTemplateClientTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.template.SearchTemplateClientTest_NOC; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GetTemplateClientTest_NOC.class, + SearchTemplateClientTest_NOC.class +}) + +public class TemplateSuite_NOC { +} + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/ViewSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/ViewSuite_NOC.java new file mode 100644 index 0000000..97be095 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/suites/ViewSuite_NOC.java @@ -0,0 +1,20 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.suites; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view.AllViewTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view.GetAuditViewClientTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view.GetChangeHistoryViewClientTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view.GetDocumentListClientTest_NOC; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GetChangeHistoryViewClientTest_NOC.class, + GetAuditViewClientTest_NOC.class, + GetDocumentListClientTest_NOC.class, + AllViewTest_NOC.class +}) + +public class ViewSuite_NOC { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/GeneralTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/GeneralTest_NOC.java similarity index 86% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/GeneralTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/GeneralTest_NOC.java index 99f4bfc..a409fc5 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/GeneralTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/GeneralTest_NOC.java @@ -1,6 +1,6 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view.GetDocumentListClientTest_NOC; +import au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view.GetDocumentListClientTest_NOC; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/GetDocumentTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/GetDocumentTest_NOC.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/GetDocumentTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/GetDocumentTest_NOC.java index 8c4746c..d27e2cc 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/GetDocumentTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/GetDocumentTest_NOC.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; @@ -18,15 +18,15 @@ import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.TestUtils; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.gov.nehta.vendorlibrary.mhr.test.utils.TestUtils; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import au.net.electronichealth.ns.wsp.xsd.standarderror._2010.StandardError; import au.net.electronichealth.ns.wsp.xsd.standarderror._2010.StandardErrorCodeType; @@ -81,12 +81,12 @@ public void test_033() throws Exception { // StandardErrorMsg msg = new StandardErrorMsg("more detail?", fault); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003604570901313", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -117,11 +117,11 @@ public void test_033() throws Exception { @Test public void test_034() throws Exception { - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003604570901313", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003624166667177", "Medicare305", null) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/RemoveDocumentTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/RemoveDocumentTest_NOC.java similarity index 72% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/RemoveDocumentTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/RemoveDocumentTest_NOC.java index 5cc3003..9e527ac 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/RemoveDocumentTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/RemoveDocumentTest_NOC.java @@ -1,26 +1,26 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.TestUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.gov.nehta.vendorlibrary.mhr.test.utils.TestUtils; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import org.junit.*; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocketFactory; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import java.io.File; import java.util.Date; @@ -71,12 +71,12 @@ public final void tearDown() throws Exception { @Test public void test_035() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -104,12 +104,12 @@ public void test_035() throws Exception { @Test public void test_036() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606792133153", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -118,12 +118,12 @@ public void test_036() throws Exception { @Test(expected = StandardErrorMsg.class) public void test_037() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606792133153", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8000627500003640", "Medicare305", null) ); try { @@ -135,3 +135,4 @@ public void test_037() throws Exception { } } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/UploadDocumentClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/UploadDocumentClientTest_NOC.java similarity index 85% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/UploadDocumentClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/UploadDocumentClientTest_NOC.java index 230819b..0729157 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/UploadDocumentClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/UploadDocumentClientTest_NOC.java @@ -1,30 +1,30 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; @@ -56,7 +56,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -132,20 +132,20 @@ public final void tearDown() throws Exception { @Test public void test_028() throws Exception { -// PCEHRHeader request = MessageComponents.createRequest +// MHRHeader request = MessageComponents.createRequest // ( -// MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), +// MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), // "8003603459803467", // MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), -// PCEHRHeader.ClientSystemType.CIS, +// MHRHeader.ClientSystemType.CIS, // MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) // ); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), "8003601243017717", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -182,12 +182,12 @@ public void test_028() throws Exception { @Test public void test_029() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -218,12 +218,12 @@ public void test_029() throws Exception { @Test public void test_030() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -257,12 +257,12 @@ public void test_030() throws Exception { */ @Test public void test_SizeAndHashWhenUsingRepositoryID() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation(/*"8003620833337558"*/ "8003628233352432", "Medicare305", null) ); @@ -306,12 +306,12 @@ public void test_SizeAndHashWhenUsingRepositoryID() throws Exception { @Test public void test_031() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -335,12 +335,12 @@ public void test_031() throws Exception { @Test public void test_032() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003604570901305", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -370,12 +370,12 @@ public void test_032() throws Exception { @Test public void testReplaceDocument() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -492,12 +492,12 @@ public void testReplaceDocument() throws Exception { @Test public void testAttachmentsInFolders() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -529,12 +529,12 @@ public void testAttachmentsInFolders() throws Exception { @Ignore @Test public void testUploadTwice() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803467", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -652,7 +652,7 @@ private static SubmissionSet createPackageWithAttachments(final byte[] rootDocum return subsetBuilder.build(); } - private static RemoveDocumentResponse removeDoc(PCEHRHeader commonHeader, String docId) throws GeneralSecurityException, StandardErrorMsg { + private static RemoveDocumentResponse removeDoc(MHRHeader commonHeader, String docId) throws GeneralSecurityException, StandardErrorMsg { RemoveDocumentClient removeClient = new RemoveDocumentClient( sslSocketFactory, SecurityUtil.getCertificate(), @@ -666,3 +666,4 @@ private static RemoveDocumentResponse removeDoc(PCEHRHeader commonHeader, String } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/UploadDocumentMetadataClient_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/UploadDocumentMetadataClient_NOC.java similarity index 79% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/UploadDocumentMetadataClient_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/UploadDocumentMetadataClient_NOC.java index 46c7fa2..b4ef58b 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/documentexchange/UploadDocumentMetadataClient_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/documentexchange/UploadDocumentMetadataClient_NOC.java @@ -1,17 +1,17 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentMetadataClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentMetadataClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.junit.After; import org.junit.Assert; @@ -36,7 +36,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -99,11 +99,11 @@ public final void setUp() throws Exception { @Test public void test_038() throws Exception { - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606792133153", MessageComponents.createProductType("NEHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CRP, + MHRHeader.ClientSystemType.CRP, MessageComponents.createAccessingOrganisation("8003629900000957", "Medicare305", null) ); @@ -155,3 +155,4 @@ public void test_040() throws Exception { return out.toByteArray(); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/AllRecordAccessTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/AllRecordAccessTest_NOC.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/AllRecordAccessTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/AllRecordAccessTest_NOC.java index 16743e5..1d23eef 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/AllRecordAccessTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/AllRecordAccessTest_NOC.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.recordaccess; import org.junit.Test; @@ -12,8 +12,8 @@ public void test_027() throws Exception { doesPCEHRExist.test_015(); doesPCEHRExist.tearDown(); - GainPCEHRAccessClientTest_NOC gainPCEHRAccess = new GainPCEHRAccessClientTest_NOC(); - GainPCEHRAccessClientTest_NOC.initialSetup(); + GainMHRAccessClientTest_NOC gainPCEHRAccess = new GainMHRAccessClientTest_NOC(); + GainMHRAccessClientTest_NOC.initialSetup(); gainPCEHRAccess.setUp(); gainPCEHRAccess.test_018(); gainPCEHRAccess.tearDown(); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/DoesPCHERExistClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/DoesPCHERExistClientTest_NOC.java similarity index 72% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/DoesPCHERExistClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/DoesPCHERExistClientTest_NOC.java index 34f0d85..f003be7 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/DoesPCHERExistClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/DoesPCHERExistClientTest_NOC.java @@ -11,24 +11,24 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.recordaccess; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MinimalCertificateVerifier; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.recordaccess; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MinimalCertificateVerifier; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; import org.junit.*; import javax.net.ssl.SSLSocketFactory; public class DoesPCHERExistClientTest_NOC { - private DoesPCEHRExistClient client; + private DoesMHRExistClient client; private static SSLSocketFactory sslSocketFactory; @BeforeClass @@ -53,7 +53,7 @@ public static void initialSetup() throws Exception { @Before public final void setUp() throws Exception { - client = new DoesPCEHRExistClient( + client = new DoesMHRExistClient( sslSocketFactory, SecurityUtil.getCertificate(), new MinimalCertificateVerifier(), @@ -75,30 +75,30 @@ public final void tearDown() throws Exception { @Test public void test_015() throws Exception { - DoesPCEHRExistResponse response = client.doesPCEHRExist( + DoesMHRExistResponse response = client.doesPCEHRExist( MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687602", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation(SecurityUtil.getHPIOMatchingCertificate(), "Medicare305", null) ) ); Assert.assertTrue(response.isPCEHRExists()); - Assert.assertEquals(DoesPCEHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); + Assert.assertEquals(DoesMHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); } @Test(expected = IllegalArgumentException.class) public void test_016() throws Exception { - DoesPCEHRExistResponse response = client.doesPCEHRExist( + DoesMHRExistResponse response = client.doesPCEHRExist( MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "800360234868760", MessageComponents.createProductType("NeHTA", "Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ) ); @@ -118,13 +118,13 @@ public void test_017() throws Exception { try { - DoesPCEHRExistResponse response = client.doesPCEHRExist( + DoesMHRExistResponse response = client.doesPCEHRExist( MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687602", MessageComponents.createProductType("NeHTA", "Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8000627500003640", "Medicare305", null) ) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/GainPCEHRAccessClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/GainMHRAccessClientTest_NOC.java similarity index 67% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/GainPCEHRAccessClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/GainMHRAccessClientTest_NOC.java index b9ec7fc..20f0f7b 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/recordaccess/GainPCEHRAccessClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/recordaccess/GainMHRAccessClientTest_NOC.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.recordaccess; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; @@ -40,25 +40,25 @@ import org.junit.Test; import au.gov.nehta.vendorlibrary.common.security.KeystoreUtil; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.GainPCEHRAccessClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccessResponse; - -public class GainPCEHRAccessClientTest_NOC { +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccessResponse; + +public class GainMHRAccessClientTest_NOC { private GetDocumentListClient listclient; - private GainPCEHRAccessClient client; + private GainMHRAccessClient client; private GetDocumentClient docclient; private static SSLSocketFactory sslSocketFactory; @@ -84,7 +84,7 @@ public boolean verify(String s, SSLSession sslSession) { @Before public final void setUp() throws Exception { - client = new GainPCEHRAccessClient( + client = new GainMHRAccessClient( sslSocketFactory, SecurityUtil.getCertificate(), SecurityUtil.getPrivateKey(), @@ -144,7 +144,7 @@ public void test_for_HealthMetrics() throws Exception { alias ); - GainPCEHRAccessClient client = new GainPCEHRAccessClient( + GainMHRAccessClient client = new GainMHRAccessClient( sslSocketFactory, signingCertificate, signingPrivateKey, @@ -152,18 +152,18 @@ public void test_for_HealthMetrics() throws Exception { Logging.GAIN_PCEHR_ACCESS ); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606792133146", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord ( - MessageComponents.createAuthorisationDetails(GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS, null) + MessageComponents.createAuthorisationDetails(GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS, null) ); HttpsURLConnection.setDefaultHostnameVerifier( @@ -177,7 +177,7 @@ public boolean verify(String s, SSLSession sslSession) { - GainPCEHRAccessResponse response=null; + GainMHRAccessResponse response=null; response = client.gainPCEHRAccess(record, request); @@ -199,11 +199,11 @@ public boolean verify(String s, SSLSession sslSession) { @Test public void test_ForSterlingSystems() throws Exception { - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003608166697110",//"8003604570901313", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -219,12 +219,12 @@ public void test_ForSterlingSystems() throws Exception { String xdsUniqueId=getXDSUniqueID(firstDocument.getExternalIdentifiers()); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord ( - MessageComponents.createAuthorisationDetails(GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS, null) + MessageComponents.createAuthorisationDetails(GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS, null) ); - GainPCEHRAccessResponse gainAccess = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse gainAccess = client.gainPCEHRAccess(record, request); System.out.println(gainAccess.getResponseStatus().getDescription()); RetrieveDocumentSetRequest.DocumentRequest docRequest = new RetrieveDocumentSetRequest.DocumentRequest(); @@ -268,17 +268,17 @@ public String getXDSUniqueID(List list){ @Test public void test_018() throws Exception { - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003601243017691", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); Assert.assertEquals("SUCCESS", response.getResponseStatus().getDescription()); @@ -287,36 +287,36 @@ public void test_018() throws Exception { @Test(expected = IllegalArgumentException.class) public void test_019() throws Exception { - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "0003602348687602", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); } @Test public void test_020() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606792133146", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord ( - MessageComponents.createAuthorisationDetails(GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS, null) + MessageComponents.createAuthorisationDetails(GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.EMERGENCY_ACCESS, null) ); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); Assert.assertEquals("SUCCESS", response.getResponseStatus().getDescription()); @@ -325,23 +325,23 @@ public void test_020() throws Exception { @Test public void test_021() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003603459803459", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord( + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord( MessageComponents.createAuthorisationDetails( - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.ACCESS_CODE, + GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.ACCESS_CODE, "12345678" ) ); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); Assert.assertEquals("SUCCESS", response.getResponseStatus().getDescription()); @@ -350,76 +350,76 @@ public void test_021() throws Exception { @Test(expected = IllegalArgumentException.class) public void test_022() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003601243017709", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord( + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord( MessageComponents.createAuthorisationDetails( - GainPCEHRAccess.PCEHRRecord.AuthorisationDetails.AccessType.ACCESS_CODE, + GainMHRAccess.MHRRecord.AuthorisationDetails.AccessType.ACCESS_CODE, null ) ); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); } @Test(expected = IllegalArgumentException.class) public void test_023() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); } @Test public void test_024() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003608833338197", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); } @Test public void test_025() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003605681935025", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = new GainPCEHRAccess.PCEHRRecord(); + GainMHRAccess.MHRRecord record = new GainMHRAccess.MHRRecord(); record.setIndividual(null); record.setAuthorisationDetails(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); Assert.assertEquals("PCEHR_ERROR_5102", response.getResponseStatus().getCode()); } @@ -427,21 +427,21 @@ public void test_025() throws Exception { @Test(expected = StandardErrorMsg.class) public void test_026() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687602", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8000627500003640", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = new GainPCEHRAccess.PCEHRRecord(); + GainMHRAccess.MHRRecord record = new GainMHRAccess.MHRRecord(); record.setAuthorisationDetails(null); record.setIndividual(null); try { - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, request); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, request); } catch (StandardErrorMsg e) { Assert.assertEquals("badParam", e.getFaultInfo().getErrorCode().value()); Assert.assertEquals("PCEHR_ERROR_0505 - Invalid HPI-O", e.getFaultInfo().getMessage()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/template/GetTemplateClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/template/GetTemplateClientTest_NOC.java similarity index 79% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/template/GetTemplateClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/template/GetTemplateClientTest_NOC.java index 6636f21..1e95853 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/template/GetTemplateClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/template/GetTemplateClientTest_NOC.java @@ -1,12 +1,12 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.template; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TemplateServiceRequestorOption; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.GetTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.template; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TemplateServiceRequestorOption; +import au.gov.nehta.vendorlibrary.mhr.clients.template.GetTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import au.net.electronichealth.ns.tplt.svc.gettemplate._1.StandardErrorMsg; import au.net.electronichealth.ns.tplt.xsd.interfaces.gettemplate._1.GetTemplateResponse; import org.junit.*; @@ -72,11 +72,11 @@ public void test_043() throws Exception { System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true"); System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true"); - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), null, MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); GetTemplateResponse response = null; @@ -96,11 +96,11 @@ public void test_043() throws Exception { public void test_044() throws Exception { Assert.fail("No valid test data."); // FIXME: add proper test data here. -// PCEHRHeader request = MessageComponents.createRequest( -// MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), +// MHRHeader request = MessageComponents.createRequest( +// MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), // null, // MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), -// PCEHRHeader.ClientSystemType.CIS, +// MHRHeader.ClientSystemType.CIS, // MessageComponents.createAccessingOrganisation("8003624166667177", "Medicare305", null) // ); // @@ -114,11 +114,11 @@ public void test_044() throws Exception { @Test public void test_045() throws Exception { - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), null, MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/template/SearchTemplateClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/template/SearchTemplateClientTest_NOC.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/template/SearchTemplateClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/template/SearchTemplateClientTest_NOC.java index 70fc3eb..562696e 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/template/SearchTemplateClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/template/SearchTemplateClientTest_NOC.java @@ -1,11 +1,11 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.template; - -import au.gov.nehta.vendorlibrary.pcehr.clients.template.SearchTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.template; + +import au.gov.nehta.vendorlibrary.mhr.clients.template.SearchTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import au.net.electronichealth.ns.tplt.xsd.common.templatescoreelements._1.TemplateMetadataType; import au.net.electronichealth.ns.tplt.xsd.interfaces.searchtemplate._1.SearchTemplateResponse; import org.junit.*; @@ -65,12 +65,12 @@ public final void tearDown() throws Exception { @Test public void test_046() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -105,12 +105,12 @@ public void test_046() throws Exception { @Test public void test_047() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -129,12 +129,12 @@ public void test_047() throws Exception { @Test public void test_048() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/AllViewTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/AllViewTest_NOC.java similarity index 89% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/AllViewTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/AllViewTest_NOC.java index 8d02632..72ca3fd 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/AllViewTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/AllViewTest_NOC.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view; import org.junit.Test; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetAuditViewClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetAuditViewClientTest_NOC.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetAuditViewClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetAuditViewClientTest_NOC.java index dd6a85f..b9722be 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetAuditViewClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetAuditViewClientTest_NOC.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view; /* * Copyright 2012 NEHTA @@ -14,14 +14,14 @@ * under the License. */ -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetAuditViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getauditview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getauditview._1.GetAuditViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getauditview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getauditview._1.GetAuditViewResponse; import org.junit.*; import javax.net.ssl.HostnameVerifier; @@ -33,7 +33,7 @@ import java.util.Date; /** - * Test cases for the {@link au.gov.nehta.vendorlibrary.pcehr.clients.view.GetAuditViewClient} class. + * Test cases for the {@link au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient} class. */ public class GetAuditViewClientTest_NOC { @@ -79,12 +79,12 @@ public final void tearDown() throws Exception { @Test public void test_008() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -98,12 +98,12 @@ public void test_008() throws Exception { @Test(expected = IllegalArgumentException.class) public void test_009() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003624166667177", "Medicare305", null) ); @@ -112,12 +112,12 @@ public void test_009() throws Exception { @Test public void test_010() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003604570901339", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -133,12 +133,12 @@ public void test_010() throws Exception { @Test(expected = StandardErrorMsg.class) public void test_011() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8000627500003640", "Medicare305", null) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetChangeHistoryViewClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetChangeHistoryViewClientTest_NOC.java similarity index 75% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetChangeHistoryViewClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetChangeHistoryViewClientTest_NOC.java index 9fd21f3..a04d69d 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetChangeHistoryViewClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetChangeHistoryViewClientTest_NOC.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetChangeHistoryViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getchangehistoryview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetChangeHistoryViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getchangehistoryview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -81,12 +81,12 @@ public final void tearDown() throws Exception { @Test public void test_005() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003604570901321", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -98,12 +98,12 @@ public void test_005() throws Exception { @Test public void test_006() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003604570901321", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -117,12 +117,12 @@ public void test_006() throws Exception { @Test(expected = StandardErrorMsg.class) public void test_007() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606792133161", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8000627500003640", "Medicare305", null) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetDocumentListClientTest_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetDocumentListClientTest_NOC.java similarity index 75% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetDocumentListClientTest_NOC.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetDocumentListClientTest_NOC.java index ead49a9..0356fc4 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/tests/view/GetDocumentListClientTest_NOC.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120724_noc/tests/view/GetDocumentListClientTest_NOC.java @@ -11,17 +11,17 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +package au.gov.nehta.vendorlibrary.mhr.test._20120724_noc.tests.view; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; import oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType; import org.junit.After; @@ -37,7 +37,7 @@ import java.util.List; /** - * Test cases for the {@link au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient} class. + * Test cases for the {@link au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient} class. */ public class GetDocumentListClientTest_NOC { @@ -84,12 +84,12 @@ public final void tearDown() throws Exception { @Test public void test_012() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003604570901313", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -112,12 +112,12 @@ public void test_012() throws Exception { @Test public void test_013() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003608166668517", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8000627500003640", "Medicare305", null) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/AllTests.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/AllTests.java similarity index 82% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/AllTests.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/AllTests.java index c8c0af9..08af889 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/AllTests.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/AllTests.java @@ -12,12 +12,12 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -33,7 +33,7 @@ public class AllTests { private static SSLSocketFactory sslSocketFactory; private static X509Certificate certificate; private static PrivateKey privateKey; - private static PCEHRHeader defaultRequest; + private static MHRHeader defaultRequest; @BeforeClass public static void setUp() throws Exception { @@ -47,10 +47,10 @@ public boolean verify(String s, SSLSession sslSession) { ); defaultRequest = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), "8003608500011184", MessageComponents.createProductType("NEHTA", "testHarness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "2", null) ); @@ -80,7 +80,7 @@ public static void tearDown() { privateKey = null; } - public static PCEHRHeader getDefaultRequest() { + public static MHRHeader getDefaultRequest() { return defaultRequest; } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/DocumentExchangeSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/DocumentExchangeSuite.java new file mode 100644 index 0000000..8796520 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/DocumentExchangeSuite.java @@ -0,0 +1,19 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.suites; + +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange.GetDocumentTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange.RemoveDocumentTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange.UploadDocumentClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange.UploadDocumentMetadataClientTest; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + UploadDocumentClientTest.class, + UploadDocumentMetadataClientTest.class, + RemoveDocumentTest.class, + GetDocumentTest.class +}) + +public class DocumentExchangeSuite { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/RecordAccessSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/RecordAccessSuite.java new file mode 100644 index 0000000..534da9b --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/RecordAccessSuite.java @@ -0,0 +1,15 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.suites; + +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.recordaccess.GainMHRAccessClientTest; +import au.gov.nehta.vendorlibrary.mhr.test.unittests.ReubenArchitectTest; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GainMHRAccessClientTest.class, + ReubenArchitectTest.class +}) + +public class RecordAccessSuite { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/RegisterSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/RegisterSuite.java similarity index 78% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/RegisterSuite.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/RegisterSuite.java index e2ad5af..5f0df31 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/RegisterSuite.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/RegisterSuite.java @@ -12,15 +12,15 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.suites; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.suites; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.registration.RegisterPCEHRClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.registration.RegisterMHRClientTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ - RegisterPCEHRClientTest.class + RegisterMHRClientTest.class }) public class RegisterSuite { diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/TemplateSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/TemplateSuite.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/TemplateSuite.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/TemplateSuite.java index 361ac2d..e66b4c5 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/TemplateSuite.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/TemplateSuite.java @@ -12,10 +12,10 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.suites; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.suites; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.template.GetTemplateClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.template.SearchTemplateClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.template.GetTemplateClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.template.SearchTemplateClientTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/TestSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/TestSuite.java similarity index 79% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/TestSuite.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/TestSuite.java index 00f8019..3b91bcc 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/TestSuite.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/TestSuite.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.suites; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.suites; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/ViewSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/ViewSuite.java new file mode 100644 index 0000000..7bff44f --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/suites/ViewSuite.java @@ -0,0 +1,20 @@ +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.suites; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view.GetAuditViewClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view.GetChangeHistoryViewClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view.GetDocumentListClientTest; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view.GetRepresentativeListClientTest; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GetDocumentListClientTest.class, + GetAuditViewClientTest.class, + GetChangeHistoryViewClientTest.class, + GetRepresentativeListClientTest.class +}) + +public class ViewSuite { +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/GetDocumentTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/GetDocumentTest.java similarity index 82% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/GetDocumentTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/GetDocumentTest.java index 34cc467..655504a 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/GetDocumentTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/GetDocumentTest.java @@ -1,10 +1,10 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; import org.junit.After; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/RemoveDocumentTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/RemoveDocumentTest.java similarity index 70% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/RemoveDocumentTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/RemoveDocumentTest.java index eb338ba..ec4ac14 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/RemoveDocumentTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/RemoveDocumentTest.java @@ -1,11 +1,11 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/UploadDocumentClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/UploadDocumentClientTest.java similarity index 87% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/UploadDocumentClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/UploadDocumentClientTest.java index 245c65f..eb9c1a1 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/UploadDocumentClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/UploadDocumentClientTest.java @@ -1,18 +1,18 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.junit.*; @@ -26,7 +26,7 @@ import javax.xml.transform.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -170,3 +170,4 @@ private static SubmissionSet createPackage(final byte[] rootDocument, X509Certif } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/UploadDocumentMetadataClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/UploadDocumentMetadataClientTest.java similarity index 65% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/UploadDocumentMetadataClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/UploadDocumentMetadataClientTest.java index 618e677..b2568e1 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/documentexchange/UploadDocumentMetadataClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/documentexchange/UploadDocumentMetadataClientTest.java @@ -1,14 +1,14 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange; - -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentMetadataClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.documentexchange; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentMetadataClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; import org.junit.After; import org.junit.Assert; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/recordaccess/DoesPCHERExistClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/recordaccess/DoesPCHERExistClientTest.java similarity index 69% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/recordaccess/DoesPCHERExistClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/recordaccess/DoesPCHERExistClientTest.java index 6525218..9c344ff 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/recordaccess/DoesPCHERExistClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/recordaccess/DoesPCHERExistClientTest.java @@ -11,13 +11,13 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.recordaccess; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; import org.junit.After; import org.junit.Assert; @@ -26,13 +26,13 @@ public class DoesPCHERExistClientTest { - private DoesPCEHRExistClient client; + private DoesMHRExistClient client; @Before public final void setUp() throws Exception { AllTests.setUp(); - client = new DoesPCEHRExistClient( + client = new DoesMHRExistClient( AllTests.getSslSocketFactory(), AllTests.getCertificate(), AllTests.getPrivateKey(), @@ -50,7 +50,7 @@ public final void tearDown() throws Exception { @Test public void test_030() throws Exception { try{ - DoesPCEHRExistResponse response = client.doesPCEHRExist(AllTests.getDefaultRequest()); + DoesMHRExistResponse response = client.doesPCEHRExist(AllTests.getDefaultRequest()); }catch(Throwable t){ t.printStackTrace(); for(StackTraceElement e: t.getStackTrace()) @@ -62,8 +62,8 @@ public void test_030() throws Exception { System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true"); System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true"); - DoesPCEHRExistResponse response = null; + DoesMHRExistResponse response = null; Assert.assertEquals(true, response.isPCEHRExists()); - Assert.assertEquals(DoesPCEHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); + Assert.assertEquals(DoesMHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); } } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/recordaccess/GainPCEHRAccessClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/recordaccess/GainMHRAccessClientTest.java similarity index 60% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/recordaccess/GainPCEHRAccessClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/recordaccess/GainMHRAccessClientTest.java index 87d67cf..2b10c52 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/recordaccess/GainPCEHRAccessClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/recordaccess/GainMHRAccessClientTest.java @@ -11,29 +11,29 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.recordaccess; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.GainPCEHRAccessClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccessResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccessResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -public class GainPCEHRAccessClientTest { +public class GainMHRAccessClientTest { - private GainPCEHRAccessClient client; + private GainMHRAccessClient client; @Before public final void setUp() throws Exception { AllTests.setUp(); - client = new GainPCEHRAccessClient( + client = new GainMHRAccessClient( AllTests.getSslSocketFactory(), AllTests.getCertificate(), AllTests.getPrivateKey(), @@ -50,8 +50,8 @@ public final void tearDown() throws Exception { @Test public void test_020() throws Exception { - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, AllTests.getDefaultRequest()); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, AllTests.getDefaultRequest()); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); Assert.assertEquals("SUCCESS", response.getResponseStatus().getDescription()); Assert.assertEquals("8003606789134875", response.getIndividual().getIhiNumber()); @@ -60,7 +60,7 @@ public void test_020() throws Exception { @Test public void test_adhoc() throws Exception { - client = new GainPCEHRAccessClient( + client = new GainMHRAccessClient( AllTests.getSslSocketFactory(), AllTests.getCertificate(), AllTests.getPrivateKey(), @@ -69,16 +69,16 @@ public void test_adhoc() throws Exception { ); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003606789133695", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation(/*"8003620833337558"*/ "8003624166667177", "Medicare305", null) ); - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record,request ); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); + GainMHRAccessResponse response = client.gainPCEHRAccess(record,request ); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); Assert.assertEquals("SUCCESS", response.getResponseStatus().getDescription()); // Assert.assertEquals("8003606789134875", response.getIndividual().getIhiNumber()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/registration/RegisterPCEHRClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/registration/RegisterMHRClientTest.java similarity index 75% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/registration/RegisterPCEHRClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/registration/RegisterMHRClientTest.java index 5d9edd4..8ac94f8 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/registration/RegisterPCEHRClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/registration/RegisterMHRClientTest.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.registration; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.registration; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -25,7 +25,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -42,33 +42,33 @@ import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.EvidenceOfIdentityCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IVCCorrespondeceChannelCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.IndigenousStatusCode; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.registration.RegisterPCEHRClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.EvidenceOfIdentityCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IVCCorrespondeceChannelCode; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.IndigenousStatusCode; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.registration.RegisterMHRClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.ContactDetailsType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.NameTypeSupp; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Sex; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.Identity.EvidenceOfIdentity; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Assertions.IvcCorrespondence; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Individual; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHR.Individual.Demographics; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.registerpcehr._2.RegisterPCEHRResponse; - -public class RegisterPCEHRClientTest { - - private RegisterPCEHRClient client; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.ContactDetailsType; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.NameTypeSupp; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Sex; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.Identity.EvidenceOfIdentity; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Assertions.IvcCorrespondence; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Individual; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHR.Individual.Demographics; +import au.net.electronichealth.ns.mhr.xsd.interfaces.registermhr._2.RegisterMHRResponse; + +public class RegisterMHRClientTest { + + private RegisterMHRClient client; private static SSLSocketFactory sslSocketFactory; private Holder currentId; @@ -103,7 +103,7 @@ public boolean verify(String s, SSLSession sslSession) { @Before public final void setUp() throws Exception { AllTests.setUp(); - client = new RegisterPCEHRClient( + client = new RegisterMHRClient( sslSocketFactory, SecurityUtil.getCertificate(), SecurityUtil.getPrivateKey(), @@ -118,9 +118,9 @@ public final void setUp() throws Exception { public void test_010() throws Exception { - RegisterPCEHR registrationDetails = new RegisterPCEHR(); + RegisterMHR registrationDetails = new RegisterMHR(); - RegisterPCEHR.Assertions assertions = new RegisterPCEHR.Assertions(); + RegisterMHR.Assertions assertions = new RegisterMHR.Assertions(); assertions.setAcceptedTermsAndConditions( true ); @@ -150,13 +150,13 @@ public void test_010() throws Exception { registrationDetails.setAssertions(assertions); //AllTests.setUp(); -// PCEHRHeader header = AllTests.getDefaultRequest(); +// MHRHeader header = AllTests.getDefaultRequest(); // header.setIhiNumber(""); //8003608166698043 CAREY BERNARD 17/11/1957 M 4 IGOR CCT BREAKFAST POINT NSW 2137 2950476561 Adult 5 - not Registered - PCEHRHeader header =getHeader("8003606792133161"); + MHRHeader header =getHeader("8003606792133161"); //header.setIhiNumber(""); - // RegisterPCEHRResponse response = client.registerPCEHR(header, registrationDetails); + // RegisterMHRResponse response = client.registerPCEHR(header, registrationDetails); // Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); } @@ -164,9 +164,9 @@ public void test_010() throws Exception { @Test public void test_080() throws Exception { - RegisterPCEHR registrationDetails = new RegisterPCEHR(); + RegisterMHR registrationDetails = new RegisterMHR(); - RegisterPCEHR.Assertions assertions = getExampleAssertions(); + RegisterMHR.Assertions assertions = getExampleAssertions(); byte[] rootDocument = modifyDocId(FileUtils.loadFile(new File("./src/test/resources/TestFiles/20120718/040/CDA_ROOT.xml")), currentId); SubmissionSet subset = createPackage(rootDocument, AllTests.getCertificate(), AllTests.getPrivateKey(), "8003619166668209", approverName_tucker); @@ -181,15 +181,15 @@ public void test_080() throws Exception { System.setProperty( "com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true" ); System.setProperty( "com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true" ); - //RegisterPCEHR.Representative rep = new RegisterPCEHR.Representative(); + //RegisterMHR.Representative rep = new RegisterMHR.Representative(); //rep.setIhiNumber("8003608166687665"); // //8003608166698043 CAREY BERNARD 17/11/1957 M 4 IGOR CCT BREAKFAST POINT NSW 2137 2950476561 Adult 5 - not Registered - PCEHRHeader header =getHeader("8003608166687665"); + MHRHeader header =getHeader("8003608166687665"); //header.setIhiNumber(""); - RegisterPCEHRResponse response = client.registerPCEHR(header, registrationDetails); + RegisterMHRResponse response = client.registerPCEHR(header, registrationDetails); if(response.getResponseStatus().getDescription() != null){ System.out.println(response.getResponseStatus().getDescription()); } @@ -200,8 +200,8 @@ public void test_080() throws Exception { @Test public void test_081() throws Exception { - RegisterPCEHR registrationDetails = new RegisterPCEHR(); - RegisterPCEHR.Assertions assertions = getExampleAssertions(); + RegisterMHR registrationDetails = new RegisterMHR(); + RegisterMHR.Assertions assertions = getExampleAssertions(); registrationDetails.setAssertions(assertions); Demographics demographics = new Demographics(); @@ -216,14 +216,14 @@ public void test_081() throws Exception { Individual ind = new Individual(); ind.setDemographics(demographics); registrationDetails.setIndividual(ind); - PCEHRHeader header = getHeader("8003604444567894"); + MHRHeader header = getHeader("8003604444567894"); - RegisterPCEHRResponse response = client.registerPCEHR(header, registrationDetails); + RegisterMHRResponse response = client.registerPCEHR(header, registrationDetails); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); } - private RegisterPCEHR.Assertions getExampleAssertions() { - RegisterPCEHR.Assertions assertions = new RegisterPCEHR.Assertions(); + private RegisterMHR.Assertions getExampleAssertions() { + RegisterMHR.Assertions assertions = new RegisterMHR.Assertions(); assertions.setAcceptedTermsAndConditions(true); // @@ -255,14 +255,14 @@ private RegisterPCEHR.Assertions getExampleAssertions() { return assertions; } - public PCEHRHeader getHeader(String ihi){ + public MHRHeader getHeader(String ihi){ return MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "JOHN ROSS", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "JOHN ROSS", false), ihi, MessageComponents.createProductType("NEHTA", "Test Harness", "1.0", "Windows 7"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003624166667177", "Medicare305", null) ); } @@ -330,3 +330,4 @@ private static SubmissionSet createPackage(final byte[] rootDocument, X509Certif return subsetBuilder.build(); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/template/GetTemplateClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/template/GetTemplateClientTest.java similarity index 75% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/template/GetTemplateClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/template/GetTemplateClientTest.java index 82e144b..f7d97c1 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/template/GetTemplateClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/template/GetTemplateClientTest.java @@ -1,10 +1,10 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.template; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.template; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TemplateServiceRequestorOption; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.GetTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TemplateServiceRequestorOption; +import au.gov.nehta.vendorlibrary.mhr.clients.template.GetTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import au.net.electronichealth.ns.tplt.xsd.interfaces.gettemplate._1.GetTemplateResponse; import org.junit.After; import org.junit.Assert; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/template/SearchTemplateClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/template/SearchTemplateClientTest.java similarity index 82% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/template/SearchTemplateClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/template/SearchTemplateClientTest.java index 0b62d2a..2d4b3db 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/template/SearchTemplateClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/template/SearchTemplateClientTest.java @@ -1,9 +1,9 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.template; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.template; -import au.gov.nehta.vendorlibrary.pcehr.clients.template.SearchTemplateClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.template.SearchTemplateClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import au.net.electronichealth.ns.tplt.xsd.common.templatescoreelements._1.TemplateMetadataType; import au.net.electronichealth.ns.tplt.xsd.interfaces.searchtemplate._1.SearchTemplateResponse; import org.junit.After; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetAuditViewClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetAuditViewClientTest.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetAuditViewClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetAuditViewClientTest.java index 4dbe6ac..55f98b3 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetAuditViewClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetAuditViewClientTest.java @@ -1,10 +1,10 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetAuditViewClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getauditview._1.GetAuditViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getauditview._1.GetAuditViewResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetChangeHistoryViewClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetChangeHistoryViewClientTest.java similarity index 63% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetChangeHistoryViewClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetChangeHistoryViewClientTest.java index 76fd336..8457326 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetChangeHistoryViewClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetChangeHistoryViewClientTest.java @@ -1,11 +1,11 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetChangeHistoryViewClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetChangeHistoryViewClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getchangehistoryview._1.GetChangeHistoryViewResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetDocumentListClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetDocumentListClientTest.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetDocumentListClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetDocumentListClientTest.java index 26285ff..c5c2368 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetDocumentListClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetDocumentListClientTest.java @@ -11,15 +11,15 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; import oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType; import org.junit.After; @@ -30,7 +30,7 @@ import java.util.List; /** - * Test cases for the {@link au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient} class. + * Test cases for the {@link au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient} class. */ public class GetDocumentListClientTest { diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetRepresentativeListClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetRepresentativeListClientTest.java similarity index 77% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetRepresentativeListClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetRepresentativeListClientTest.java index 28106de..e2c8928 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/tests/view/GetRepresentativeListClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120801_pm1/tests/view/GetRepresentativeListClientTest.java @@ -12,13 +12,13 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.tests.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetRepresentativeListClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetRepresentativeListClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120801_pm1.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/AllTests.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/AllTests.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/AllTests.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/AllTests.java index 29d0a0c..e294472 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/AllTests.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/AllTests.java @@ -12,12 +12,12 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc; +package au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -33,7 +33,7 @@ public class AllTests { private static SSLSocketFactory sslSocketFactory; private static X509Certificate certificate; private static PrivateKey privateKey; - private static PCEHRHeader defaultRequest; + private static MHRHeader defaultRequest; @BeforeClass public static void setUp() throws Exception { @@ -47,11 +47,11 @@ public boolean verify(String s, SSLSession sslSession) { ); defaultRequest = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Henry Button", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Henry Button", false), "8003608666701594", // "8003602345690302", MessageComponents.createProductType("NEHTA", "dummyCISusr1", "dummyCISusrV1", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Good Hospital", null) ); @@ -81,7 +81,7 @@ public static void tearDown() { privateKey = null; } - public static PCEHRHeader getDefaultRequest() { + public static MHRHeader getDefaultRequest() { return defaultRequest; } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/documentexchange/TestGetDocument.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/documentexchange/TestGetDocument.java similarity index 85% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/documentexchange/TestGetDocument.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/documentexchange/TestGetDocument.java index a23b6c4..294f2f1 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/documentexchange/TestGetDocument.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/documentexchange/TestGetDocument.java @@ -12,13 +12,13 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.documentexchange; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; import org.junit.After; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/documentexchange/UploadDocumentClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/documentexchange/UploadDocumentClientTest.java similarity index 92% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/documentexchange/UploadDocumentClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/documentexchange/UploadDocumentClientTest.java index 7192afc..091c558 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/documentexchange/UploadDocumentClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/documentexchange/UploadDocumentClientTest.java @@ -12,28 +12,28 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.documentexchange; import au.gov.nehta.vendorlibrary.clinicalpackage.core.Member; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; import au.gov.nehta.vendorlibrary.common.security.KeystoreUtil; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import com.sun.xml.ws.transport.http.client.HttpTransportPipe; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryError; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; @@ -49,7 +49,7 @@ import javax.xml.transform.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -187,11 +187,11 @@ public void test_UploadDocument_682() throws Exception { PackagingUtility.writeZip(subset, "./src/test/resources/TestFiles/Generated/out_" + new Date().getTime() + ".zip"); - PCEHRHeader defaultRequest = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Henry Button", false), + MHRHeader defaultRequest = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Henry Button", false), "8003608666701594", MessageComponents.createProductType("NEHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Good Hospital", null) ); @@ -272,12 +272,12 @@ public void test_UploadDocument_682_LocalID() throws Exception { PackagingUtility.writeZip(subset, "./src/test/resources/TestFiles/Generated/out_" + new Date().getTime() + ".zip"); - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.LOCAL_SYSTEM_IDENTIFIER, "buttonj001", null, "Henry Button", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.LOCAL_SYSTEM_IDENTIFIER, "buttonj001", null, "Henry Button", false), "8003608666701594", // null, MessageComponents.createProductType("NEHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Good Hospital", null) ); @@ -322,11 +322,11 @@ public void test_UploadDocument_682_PAI_D() throws Exception { PackagingUtility.writeZip(subset, "./src/test/resources/TestFiles/Generated/out_" + new Date().getTime() + ".zip"); - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Henry Button", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Henry Button", false), "8003608666701594", MessageComponents.createProductType("NEHTA", "dummyCISusr1", "dummyCISusrV1", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Good Hospital", null) ); @@ -414,12 +414,12 @@ public void test_UploadDocument_SVT_HPII() throws Exception { PackagingUtility.writeZip(subset, "./src/test/resources/TestFiles/Generated/out_" + new Date().getTime() + ".zip"); //8003618334357646, 8003608666701594, dummyCISusr1, dummyCISusrV1 dummyCISusrV1 - PCEHRHeader request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Anthony TUCKER", false), + MHRHeader request = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Anthony TUCKER", false), "8003608666701594", //. 8003608666701594 MessageComponents.createProductType("NEHTA", "Test Harness", "1.0", "Windows 7"), -// PCEHRHeader.ClientSystemType.CIS, - PCEHRHeader.ClientSystemType.CIS, +// MHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Good Hospital", null) //8003620833335909 Medicare305 ); @@ -612,3 +612,4 @@ public String[] getServerAliases(final String keyType, final Principal[] issuers } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/recordaccess/GainPCEHRAccessClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/recordaccess/GainMHRAccessClientTest.java similarity index 59% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/recordaccess/GainPCEHRAccessClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/recordaccess/GainMHRAccessClientTest.java index d33d063..e66f715 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/recordaccess/GainPCEHRAccessClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/recordaccess/GainMHRAccessClientTest.java @@ -11,28 +11,28 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.recordaccess; +package au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.recordaccess; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.GainPCEHRAccessClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccess; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.GainPCEHRAccessResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccess; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.GainMHRAccessResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -public class GainPCEHRAccessClientTest { +public class GainMHRAccessClientTest { - private GainPCEHRAccessClient client; + private GainMHRAccessClient client; @Before public final void setUp() throws Exception { AllTests.setUp(); - client = new GainPCEHRAccessClient( + client = new GainMHRAccessClient( AllTests.getSslSocketFactory(), AllTests.getCertificate(), AllTests.getPrivateKey(), @@ -49,8 +49,8 @@ public final void tearDown() throws Exception { @Test public void test_020() throws Exception { - GainPCEHRAccess.PCEHRRecord record = MessageComponents.createGainPCEHRRecord(null); - GainPCEHRAccessResponse response = client.gainPCEHRAccess(record, AllTests.getDefaultRequest()); + GainMHRAccess.MHRRecord record = MessageComponents.createGainMHRRecord(null); + GainMHRAccessResponse response = client.gainPCEHRAccess(record, AllTests.getDefaultRequest()); Assert.assertEquals("PCEHR_SUCCESS", response.getResponseStatus().getCode()); Assert.assertEquals("SUCCESS", response.getResponseStatus().getDescription()); Assert.assertEquals("8003601008083417", response.getIndividual().getIhiNumber()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/view/GetDocumentListClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/view/GetDocumentListClientTest.java similarity index 75% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/view/GetDocumentListClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/view/GetDocumentListClientTest.java index 7320f9b..caad190 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120820_ptc/view/GetDocumentListClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120820_ptc/view/GetDocumentListClientTest.java @@ -11,15 +11,15 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.view; +package au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.view; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentQueryParams; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentStatus; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient; -import au.gov.nehta.vendorlibrary.pcehr.test._20120820_ptc.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentQueryParams; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentStatus; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient; +import au.gov.nehta.vendorlibrary.mhr.test._20120820_ptc.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse; import oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType; import org.junit.After; @@ -30,7 +30,7 @@ import java.util.List; /** - * Test cases for the {@link au.gov.nehta.vendorlibrary.pcehr.clients.view.GetDocumentListClient} class. + * Test cases for the {@link au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient} class. */ public class GetDocumentListClientTest { diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120926_dev/AllTests.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120926_dev/AllTests.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120926_dev/AllTests.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120926_dev/AllTests.java index 7586b26..7996b43 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120926_dev/AllTests.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120926_dev/AllTests.java @@ -12,12 +12,12 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120926_dev; +package au.gov.nehta.vendorlibrary.mhr.test._20120926_dev; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -33,7 +33,7 @@ public class AllTests { private static SSLSocketFactory sslSocketFactory; private static X509Certificate certificate; private static PrivateKey privateKey; - private static PCEHRHeader defaultRequest; + private static MHRHeader defaultRequest; @BeforeClass public static void setUp() throws Exception { @@ -47,10 +47,10 @@ public boolean verify(String s, SSLSession sslSession) { ); defaultRequest = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Anthony TUCKER", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Anthony TUCKER", false), "8003601243017717", MessageComponents.createProductType("NEHTA", "testHarness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "2", null) ); @@ -80,7 +80,7 @@ public static void tearDown() { privateKey = null; } - public static PCEHRHeader getDefaultRequest() { + public static MHRHeader getDefaultRequest() { return defaultRequest; } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120926_dev/documentexchange/UploadDocumentClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120926_dev/documentexchange/UploadDocumentClientTest.java similarity index 84% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120926_dev/documentexchange/UploadDocumentClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120926_dev/documentexchange/UploadDocumentClientTest.java index b0ff660..2e11e55 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120926_dev/documentexchange/UploadDocumentClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/_20120926_dev/documentexchange/UploadDocumentClientTest.java @@ -12,7 +12,7 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test._20120926_dev.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test._20120926_dev.documentexchange; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -34,7 +34,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -54,21 +54,21 @@ import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MinimalCertificateVerifier; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120926_dev.AllTests; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MinimalCertificateVerifier; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120926_dev.AllTests; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; public class UploadDocumentClientTest { @@ -140,12 +140,12 @@ public void test_uploadDocument() throws Exception { @Test public void test_pathologyMaxDocUpload() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), "8003601243017717", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -174,12 +174,12 @@ public void test_pathologyMaxDocUpload() throws Exception { @Test public void test_pathologyMinDocUpload() throws Exception { - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), "8003601243017717", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); @@ -255,3 +255,4 @@ private static SubmissionSet createPackage(final byte[] rootDocument, X509Certif } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/load/AllTests.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/load/AllTests.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/load/AllTests.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/load/AllTests.java index ae11348..ed1c20a 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/load/AllTests.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/load/AllTests.java @@ -12,12 +12,12 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.load; +package au.gov.nehta.vendorlibrary.mhr.test.load; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -33,7 +33,7 @@ public class AllTests { private static SSLSocketFactory sslSocketFactory; private static X509Certificate certificate; private static PrivateKey privateKey; - private static PCEHRHeader defaultRequest; + private static MHRHeader defaultRequest; @BeforeClass public static void setUp() throws Exception { @@ -47,10 +47,10 @@ public boolean verify(String s, SSLSession sslSession) { ); defaultRequest = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), "8003601008083417", MessageComponents.createProductType("NEHTA", "testHarness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003627500001433", "2", null) ); @@ -80,7 +80,7 @@ public static void tearDown() { privateKey = null; } - public static PCEHRHeader getDefaultRequest() { + public static MHRHeader getDefaultRequest() { return defaultRequest; } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/load/documentexchange/LoadTests.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/load/documentexchange/LoadTests.java similarity index 90% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/load/documentexchange/LoadTests.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/load/documentexchange/LoadTests.java index 4d3a7aa..f88b6c4 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/load/documentexchange/LoadTests.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/load/documentexchange/LoadTests.java @@ -12,20 +12,20 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.load.documentexchange; +package au.gov.nehta.vendorlibrary.mhr.test.load.documentexchange; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.CodedValue; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.test.load.AllTests; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.CodedValue; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.test.load.AllTests; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; @@ -51,7 +51,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -208,3 +208,4 @@ private static SubmissionSet createPackage(final byte[] rootDocument, X509Certif } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/system/TestGetView.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/system/TestGetView.java similarity index 83% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/system/TestGetView.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/system/TestGetView.java index 548bc01..b7ae6c9 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/system/TestGetView.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/system/TestGetView.java @@ -1,26 +1,26 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.system; +package au.gov.nehta.vendorlibrary.mhr.test.system; import au.gov.nehta.vendorlibrary.common.security.KeystoreUtil; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.TypedViewResponse; -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetViewClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getview._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getview._1.GetViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.medicareoverview._1.MedicareOverview; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.observationview._1.ObservationView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportView; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.TypedViewResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetViewClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.svc.getview._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getview._1.GetViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverviewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.medicareoverview._1.MedicareOverview; +import au.net.electronichealth.ns.mhr.xsd.interfaces.observationview._1.ObservationView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportView; +import au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportViewResponse; +import au.net.electronichealth.ns.mhr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView; import org.junit.*; import javax.net.ssl.HostnameVerifier; @@ -39,7 +39,7 @@ public class TestGetView { private static final String IHI_FOR_DRP2_USE = "8003601243017691"; private static final String IHI_FOR_DRP2_USE2 = "8003601243017717"; private static final String IHI_FOR_DRP2_USE3 = "8003604570901339"; - static PCEHRHeader request; + static MHRHeader request; @BeforeClass public static void initialSetup() throws Exception { @@ -75,10 +75,10 @@ public final void setUp() throws Exception { ); request = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "ROSS JOHN", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "ROSS JOHN", false), "8003608666701594", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 8.1"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null)); } @@ -278,12 +278,12 @@ public void test__PCEHR_ACCENTURE_VPN__PrescriptionAndDispenseView() throws Exce ); - PCEHRHeader request = MessageComponents.createRequest + MHRHeader request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "pwilford", null, "PhilipWilford", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "pwilford", null, "PhilipWilford", false), "8003602345690302", MessageComponents.createProductType("NeHTA", "dummyCISusr1", "dummyCISusrV1", "Windows 7"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003629900024122", "Medicare-305", null) ); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/AllTests_Reuben.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/AllTests_Reuben.java similarity index 82% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/AllTests_Reuben.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/AllTests_Reuben.java index 2597bfb..296c9b6 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/AllTests_Reuben.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/AllTests_Reuben.java @@ -12,12 +12,12 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityConstants; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityConstants; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -33,7 +33,7 @@ public class AllTests_Reuben { private static SSLSocketFactory sslSocketFactory; private static X509Certificate certificate; private static PrivateKey privateKey; - private static PCEHRHeader defaultRequest; + private static MHRHeader defaultRequest; @BeforeClass public static void setUp() throws Exception { @@ -47,10 +47,10 @@ public boolean verify(String s, SSLSession sslSession) { ); defaultRequest = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618233333524", null, "PHIL TOUSANT", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618233333524", null, "PHIL TOUSANT", false), "8003602348687602", MessageComponents.createProductType("NEHTA Implementation Architects", "CHIRON", "1.0.0", "Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003626566667756", "DHS5749", null) ); @@ -80,7 +80,7 @@ public static void tearDown() { privateKey = null; } - public static PCEHRHeader getDefaultRequest() { + public static MHRHeader getDefaultRequest() { return defaultRequest; } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/CommonHeaderValidatorTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/CommonHeaderValidatorTest.java similarity index 68% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/CommonHeaderValidatorTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/CommonHeaderValidatorTest.java index 7321df7..57015fc 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/CommonHeaderValidatorTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/CommonHeaderValidatorTest.java @@ -1,7 +1,7 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.CommonHeaderValidator; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.CommonHeaderValidator; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.Test; public class CommonHeaderValidatorTest { @@ -13,28 +13,28 @@ public void validate_acceptsValidHeaderWhenIhiRequired() { @Test public void validate_acceptsMissingIhiWhenNotRequired() { - PCEHRHeader header = validHeader(); + MHRHeader header = validHeader(); header.setIhiNumber(null); CommonHeaderValidator.validate(header, false); } @Test(expected = NullPointerException.class) public void validate_rejectsMissingIhiWhenRequired() { - PCEHRHeader header = validHeader(); + MHRHeader header = validHeader(); header.setIhiNumber(null); CommonHeaderValidator.validate(header, true); } @Test(expected = IllegalArgumentException.class) public void validate_rejectsInvalidIhiPrefix() { - PCEHRHeader header = validHeader(); + MHRHeader header = validHeader(); header.setIhiNumber("1234501234567890"); CommonHeaderValidator.validate(header, true); } @Test(expected = NullPointerException.class) public void validate_rejectsRoleMissingWhenAuditRoleEnabled() { - PCEHRHeader header = validHeader(); + MHRHeader header = validHeader(); header.getUser().setUseRoleForAudit(true); header.getUser().setRole(null); CommonHeaderValidator.validate(header, false); @@ -42,31 +42,31 @@ public void validate_rejectsRoleMissingWhenAuditRoleEnabled() { @Test(expected = NullPointerException.class) public void validate_rejectsOrganisationIdWhenOrganisationPresent() { - PCEHRHeader header = validHeader(); + MHRHeader header = validHeader(); header.getAccessingOrganisation().setOrganisationID(null); CommonHeaderValidator.validate(header, false); } - private static PCEHRHeader validHeader() { - PCEHRHeader.User user = new PCEHRHeader.User(); - user.setIDType(PCEHRHeader.User.IDType.HPII); + private static MHRHeader validHeader() { + MHRHeader.User user = new MHRHeader.User(); + user.setIDType(MHRHeader.User.IDType.HPII); user.setID("8003610000001145"); user.setUserName("test-user"); user.setUseRoleForAudit(false); - PCEHRHeader.ProductType productType = new PCEHRHeader.ProductType(); + MHRHeader.ProductType productType = new MHRHeader.ProductType(); productType.setVendor("ADHA"); productType.setProductName("myhr-test"); productType.setProductVersion("1.0.0"); productType.setPlatform("JVM"); - PCEHRHeader.AccessingOrganisation org = new PCEHRHeader.AccessingOrganisation(); + MHRHeader.AccessingOrganisation org = new MHRHeader.AccessingOrganisation(); org.setOrganisationID("8003620000001234"); org.setOrganisationName("Test Organisation"); - PCEHRHeader header = new PCEHRHeader(); + MHRHeader header = new MHRHeader(); header.setIhiNumber("8003601234567890"); - header.setClientSystemType(PCEHRHeader.ClientSystemType.OTHER); + header.setClientSystemType(MHRHeader.ClientSystemType.OTHER); header.setUser(user); header.setProductType(productType); header.setAccessingOrganisation(org); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/DateUtilsTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/DateUtilsTest.java similarity index 96% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/DateUtilsTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/DateUtilsTest.java index 954899e..64b94fb 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/DateUtilsTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/DateUtilsTest.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; /* * Copyright 2012 NEHTA * @@ -13,7 +13,7 @@ * under the License. */ -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.DateUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.DateUtils; import org.junit.*; import java.util.HashMap; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/HandlerStuff.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/HandlerStuff.java similarity index 82% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/HandlerStuff.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/HandlerStuff.java index 097f230..450cb6e 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/HandlerStuff.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/HandlerStuff.java @@ -12,22 +12,22 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XDSConstants; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.*; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.XDSMapper; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.AllTests; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XDSConstants; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.*; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.XDSMapper; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test._20120718_regression.AllTests; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Signature; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.Timestamp; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Signature; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.Timestamp; import ihe.iti.xds_b._2007.DocumentRepositoryPortType; import ihe.iti.xds_b._2007.DocumentRepositoryService; import ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequest; @@ -36,14 +36,14 @@ import javax.xml.namespace.QName; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.ws.BindingProvider; -import javax.xml.ws.Holder; -import javax.xml.ws.Service; -import javax.xml.ws.WebServiceClient; -import javax.xml.ws.handler.Handler; -import javax.xml.ws.handler.HandlerResolver; -import javax.xml.ws.handler.PortInfo; -import javax.xml.ws.soap.SOAPBinding; +import jakarta.xml.ws.BindingProvider; +import jakarta.xml.ws.Holder; +import jakarta.xml.ws.Service; +import jakarta.xml.ws.WebServiceClient; +import jakarta.xml.ws.handler.Handler; +import jakarta.xml.ws.handler.HandlerResolver; +import jakarta.xml.ws.handler.PortInfo; +import jakarta.xml.ws.soap.SOAPBinding; import javax.xml.xpath.XPathExpressionException; import java.io.File; import java.io.IOException; @@ -86,11 +86,11 @@ public List getHandlerChain(PortInfo portInfo) { SubmissionSet subset = createPackage(rootDocument, AllTests.getCertificate(), AllTests.getPrivateKey(), "8003619166668209", approverName_tucker); byte[] packageContent = PackagingUtility.createZip(subset); - PCEHRHeader commonHeader = MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), + MHRHeader commonHeader = MessageComponents.createRequest( + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), "8003608500011184", MessageComponents.createProductType("NEHTA", "testHarness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003622500001608", "2", null) ); @@ -158,3 +158,4 @@ private static SubmissionSet createPackage(final byte[] rootDocument, X509Certif return subsetBuilder.build(); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/JaxwsRuntimeSmokeTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/JaxwsRuntimeSmokeTest.java similarity index 87% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/JaxwsRuntimeSmokeTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/JaxwsRuntimeSmokeTest.java index fcd85f1..129c814 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/JaxwsRuntimeSmokeTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/JaxwsRuntimeSmokeTest.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import static org.junit.Assert.assertNotNull; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataStartStopTimeTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataStartStopTimeTest.java similarity index 81% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataStartStopTimeTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataStartStopTimeTest.java index d330db9..841e8ab 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataStartStopTimeTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataStartStopTimeTest.java @@ -1,26 +1,27 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import au.gov.nehta.common.utils.IOUtils; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.io.File; +import java.nio.charset.StandardCharsets; import java.security.GeneralSecurityException; import java.security.PrivateKey; import java.security.cert.X509Certificate; public class MetadataStartStopTimeTest { - static final PCEHRHeader commonHeader = getHeader(); + static final MHRHeader commonHeader = getHeader(); static final PersonNameType personNameType = getPersonNameType(); @Before @@ -39,7 +40,7 @@ private static PersonNameType getPersonNameType() { @Test public void testPathologyMinDocumentStartTime() throws Exception { String doc = IOUtils.read(new File("src/test/resources/TestFiles/pathologyDI/PathologyResultReport_3A_Min.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes(StandardCharsets.UTF_8)); Assert.assertEquals("20070227030000", documentMetadata.getServiceStartTime()); Assert.assertEquals(documentMetadata.getServiceStartTime(), documentMetadata.getServiceStopTime()); @@ -48,7 +49,7 @@ public void testPathologyMinDocumentStartTime() throws Exception { @Test public void testPathologyMaxDocumentStartTime() throws Exception { String doc = IOUtils.read(new File("src/test/resources/TestFiles/pathologyDI/PathologyResultReport_3A_Max.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes(StandardCharsets.UTF_8)); Assert.assertEquals("20140227030000", documentMetadata.getServiceStartTime()); Assert.assertEquals(documentMetadata.getServiceStartTime(), documentMetadata.getServiceStopTime()); @@ -58,7 +59,7 @@ public void testPathologyMaxDocumentStartTime() throws Exception { @Test public void testDIMinDocumentStartTime() throws Exception { String doc = IOUtils.read(new File("src/test/resources/TestFiles/pathologyDI/DiagnosticImagingReport_3A_Min.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes(StandardCharsets.UTF_8)); //this document has not image time, start time, or fixed time value should be creation time Assert.assertEquals(documentMetadata.getCreationTime(), documentMetadata.getServiceStartTime()); @@ -68,7 +69,7 @@ public void testDIMinDocumentStartTime() throws Exception { @Test public void testDIMaxDocumentStartTime() throws Exception { String doc = IOUtils.read(new File("src/test/resources/TestFiles/pathologyDI/DiagnosticImagingReport_3A_Max.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(commonHeader, doc.getBytes(StandardCharsets.UTF_8)); // this datetime has rolled back to the previous day because of +10 timezone conversion to utc Assert.assertEquals("20140930223702", documentMetadata.getServiceStartTime()); @@ -76,13 +77,13 @@ public void testDIMaxDocumentStartTime() throws Exception { } - private static PCEHRHeader getHeader() { + private static MHRHeader getHeader() { return MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003618334357646", null, "Ross John", false), "8003601243017717", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "Medicare305", null) ); } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsDefaultLangTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsDefaultLangTest.java similarity index 72% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsDefaultLangTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsDefaultLangTest.java index dda7ccf..f6f2103 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsDefaultLangTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsDefaultLangTest.java @@ -1,11 +1,11 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import au.gov.nehta.common.utils.IOUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.Assert; import org.junit.Test; import org.xml.sax.SAXException; @@ -14,18 +14,19 @@ import javax.xml.xpath.XPathExpressionException; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; public class MetadataUtilsDefaultLangTest { - private static PCEHRHeader exampleHeader; + private static MHRHeader exampleHeader; static { exampleHeader = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003624166667177", "Medicare305", null) ); } @@ -34,7 +35,7 @@ public class MetadataUtilsDefaultLangTest { public void testEnUS() throws XPathExpressionException, ParserConfigurationException, IOException, SAXException { // document lang is en-US String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/PCEHRPrescriptionRecord_3A_Min.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); // should be as specified Assert.assertEquals("en-US", documentMetadata.getLanguageCode()); } @@ -44,7 +45,7 @@ public void testDefaultLang() throws XPathExpressionException, ParserConfigurati // has no lang code String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/PCEHRDispenseRecord_3A_Min.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); /// should default to au Assert.assertEquals("en-AU", documentMetadata.getLanguageCode()); } @@ -54,7 +55,7 @@ public void testNoTitleIsSupplied() throws XPathExpressionException, ParserConfi // cups requests that no xds metadata tile is supplied with the document upload. // check that the title field is not filled for metadata String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/PCEHRPrescriptionRecord_3A_Min.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); // should be null Assert.assertNull(documentMetadata.getTitle()); } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsOrgIDNameTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsOrgIDNameTest.java similarity index 74% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsOrgIDNameTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsOrgIDNameTest.java index b239e39..2ef97ff 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsOrgIDNameTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsOrgIDNameTest.java @@ -1,11 +1,11 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import au.gov.nehta.common.utils.IOUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.Assert; import org.junit.Test; import org.xml.sax.SAXException; @@ -14,18 +14,19 @@ import javax.xml.xpath.XPathExpressionException; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; public class MetadataUtilsOrgIDNameTest { - private static PCEHRHeader exampleHeader; + private static MHRHeader exampleHeader; static { exampleHeader = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003624166667177", "Medicare305", null) ); } @@ -33,7 +34,7 @@ public class MetadataUtilsOrgIDNameTest { @Test public void test_Organisation_CUSTODIAN_NameId() throws XPathExpressionException, ParserConfigurationException, IOException, SAXException { String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/CUSTODIAN_ORG_NAME_TEST.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); Assert.assertEquals("General Practice Clinic", documentMetadata.getAuthorInstitution().getOrganisationName()); Assert.assertEquals("1.2.36.1.2001.1003.0.8003620833333789", documentMetadata.getAuthorInstitution().getOrganisationIdentifier()); @@ -44,7 +45,7 @@ public void test_Organisation_CUSTODIAN_NameId() throws XPathExpressionException @Test public void test_Organisation_HCF_NameId() throws XPathExpressionException, ParserConfigurationException, IOException, SAXException { String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/HCF_ORG_NAME_TEST.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); Assert.assertEquals("West End Healthiness", documentMetadata.getAuthorInstitution().getOrganisationName()); Assert.assertEquals("1.2.36.1.2001.1003.0.8003620833333782", documentMetadata.getAuthorInstitution().getOrganisationIdentifier()); @@ -53,7 +54,7 @@ public void test_Organisation_HCF_NameId() throws XPathExpressionException, Pars @Test public void test_Organisation_AUTHOR_NameId() throws XPathExpressionException, ParserConfigurationException, IOException, SAXException { String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/Author_ORG_NAME_TEST.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); Assert.assertEquals("Author Good Hospital", documentMetadata.getAuthorInstitution().getOrganisationName()); Assert.assertEquals("1.2.36.1.2001.1003.0.8013620833333787", documentMetadata.getAuthorInstitution().getOrganisationIdentifier()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsTimeTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsTimeTest.java similarity index 70% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsTimeTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsTimeTest.java index 6ed0f28..bf95d7e 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/MetadataUtilsTimeTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MetadataUtilsTimeTest.java @@ -1,10 +1,10 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import au.gov.nehta.common.utils.IOUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.DocumentMetadata; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.DocumentMetadata; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.MetadataUtils; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; import org.junit.Assert; import org.junit.Test; import org.xml.sax.SAXException; @@ -13,18 +13,19 @@ import javax.xml.xpath.XPathExpressionException; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; public class MetadataUtilsTimeTest { - private static PCEHRHeader exampleHeader; + private static MHRHeader exampleHeader; static { exampleHeader = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Ross John", false), "8003602348687628", MessageComponents.createProductType("NeHTA", "Test Harness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003624166667177", "Medicare305", null) ); } @@ -32,7 +33,7 @@ public class MetadataUtilsTimeTest { @Test public void testPrescriptionTime() throws XPathExpressionException, ParserConfigurationException, IOException, SAXException { String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/PCEHRPrescriptionRecord_3A_Min.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); // actual time 20130226155637+1000 Assert.assertEquals("20130226055637", documentMetadata.getServiceStartTime()); Assert.assertEquals("20130226055637", documentMetadata.getServiceStopTime()); @@ -41,7 +42,7 @@ public void testPrescriptionTime() throws XPathExpressionException, ParserConfig @Test public void testDispenseTime() throws XPathExpressionException, ParserConfigurationException, IOException, SAXException { String doc = IOUtils.read(new File("src/test/resources/TestFiles/metadataTest/PCEHRDispenseRecord_3A_Min.xml")); - DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes()); + DocumentMetadata documentMetadata = MetadataUtils.toDocumentMetadata(exampleHeader, doc.getBytes(StandardCharsets.UTF_8)); /// actual time 20130226115638+1000 Assert.assertEquals("20130226015638", documentMetadata.getServiceStartTime()); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MhrFacadeCoverageTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MhrFacadeCoverageTest.java new file mode 100644 index 0000000..ad9a078 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MhrFacadeCoverageTest.java @@ -0,0 +1,152 @@ +package au.gov.nehta.vendorlibrary.mhr.test.unittests; + +import au.gov.nehta.vendorlibrary.mhr.clients.common.Client; +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetViewClient; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import jakarta.xml.ws.Service; +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Locks facade and service coverage to the third-party B2B set in + * mhr-b2b-client-dotnet README (15 logical interfaces, getView + 7 views). + */ +public class MhrFacadeCoverageTest { + + /** + * Logical name from mhr-b2b-client-dotnet README -> Java facade. + * findDocuments maps to GetDocumentListClient (RegistryStoredQuery). + */ + private static final Map DOT_NET_LOGICAL_TO_FACADE = Map.ofEntries( + Map.entry("doesPCEHRExist", + "au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient"), + Map.entry("gainPCEHRAccess", + "au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient"), + Map.entry("uploadDocument", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient"), + Map.entry("retrieveDocument", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient"), + Map.entry("uploadDocumentMetadata", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentMetadataClient"), + Map.entry("findDocuments", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient"), + Map.entry("removeDocument", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient"), + Map.entry("getAuditView", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient"), + Map.entry("getChangeHistoryView", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetChangeHistoryViewClient"), + Map.entry("getView", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetViewClient"), + Map.entry("getTemplate", + "au.gov.nehta.vendorlibrary.mhr.clients.template.GetTemplateClient"), + Map.entry("searchTemplate", + "au.gov.nehta.vendorlibrary.mhr.clients.template.SearchTemplateClient"), + Map.entry("getIndividualDetailsView", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetIndividualDetailsViewClient"), + Map.entry("getRepresentativeList", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetRepresentativeListClient"), + Map.entry("registerPCEHR", + "au.gov.nehta.vendorlibrary.mhr.clients.registration.RegisterMHRClient")); + + private static final List FACADE_NAMES = Arrays.asList( + "au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient", + "au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.GainMHRAccessClient", + "au.gov.nehta.vendorlibrary.mhr.clients.registration.RegisterMHRClient", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentMetadataClient", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetDocumentListClient", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient", + "au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetViewClient", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetIndividualDetailsViewClient", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetRepresentativeListClient", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetAuditViewClient", + "au.gov.nehta.vendorlibrary.mhr.clients.view.GetChangeHistoryViewClient", + "au.gov.nehta.vendorlibrary.mhr.clients.template.GetTemplateClient", + "au.gov.nehta.vendorlibrary.mhr.clients.template.SearchTemplateClient"); + + private static final List SERVICE_NAMES = Arrays.asList( + "au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.MHRProfileService", + "au.net.electronichealth.ns.mhr.svc.registermhr._2.RegisterMHRService", + "ihe.iti.xds_b._2007.DocumentRegistryService", + "ihe.iti.xds_b._2007.DocumentRepositoryService", + "au.net.electronichealth.ns.mhr.svc.removedocument._1.RemoveDocumentService", + "au.net.electronichealth.ns.mhr.svc.getauditview._1.GetAuditViewService", + "au.net.electronichealth.ns.mhr.svc.getchangehistoryview._1.GetChangeHistoryViewService", + "au.net.electronichealth.ns.mhr.svc.getindividualdetailsview._2.GetIndividualDetailsViewService", + "au.net.electronichealth.ns.mhr.svc.getrepresentativelist._1.GetRepresentativeListService", + "au.net.electronichealth.ns.mhr.svc.getview._1.GetViewService", + "au.net.electronichealth.ns.tplt.svc.gettemplate._1.GetTemplateService", + "au.net.electronichealth.ns.tplt.svc.searchtemplate._1.SearchTemplateService"); + + private static final List GET_VIEW_REQUEST_TYPES = Arrays.asList( + "au.net.electronichealth.ns.mhr.xsd.interfaces.healthcheckscheduleview._1.HealthCheckScheduleView", + "au.net.electronichealth.ns.mhr.xsd.interfaces.medicareoverview._1.MedicareOverview", + "au.net.electronichealth.ns.mhr.xsd.interfaces.observationview._1.ObservationView", + "au.net.electronichealth.ns.mhr.xsd.interfaces.prescriptionanddispenseview._1.PrescriptionAndDispenseView", + "au.net.electronichealth.ns.mhr.xsd.interfaces.healthrecordoverview._1.HealthRecordOverView", + "au.net.electronichealth.ns.mhr.xsd.interfaces.diagnosticimagingreportview._1.DiagnosticImagingReportView", + "au.net.electronichealth.ns.mhr.xsd.interfaces.pathologyreportview._1.PathologyReportView"); + + @Test + public void allMhrFacadesAreOnClasspath() throws Exception { + Assert.assertEquals(15, FACADE_NAMES.size()); + + for (String facadeName : FACADE_NAMES) { + Class facadeType = Class.forName(facadeName); + Assert.assertTrue(facadeName + " must extend Client", + Client.class.isAssignableFrom(facadeType)); + } + } + + @Test + public void facadesCoverDotNetLogicalB2bSet() throws Exception { + Assert.assertEquals(15, DOT_NET_LOGICAL_TO_FACADE.size()); + for (Map.Entry entry : DOT_NET_LOGICAL_TO_FACADE.entrySet()) { + Class facadeType = Class.forName(entry.getValue()); + Assert.assertTrue(entry.getKey() + " -> " + entry.getValue(), + Client.class.isAssignableFrom(facadeType)); + Assert.assertTrue("orphan facade mapping " + entry.getValue(), + FACADE_NAMES.contains(entry.getValue())); + } + } + + @Test + public void allMhrGeneratedServicesAreOnClasspath() throws Exception { + Assert.assertEquals(12, SERVICE_NAMES.size()); + + for (String serviceName : SERVICE_NAMES) { + Class serviceType = Class.forName(serviceName); + Assert.assertTrue(serviceName + " must extend jakarta.xml.ws.Service", + Service.class.isAssignableFrom(serviceType)); + } + } + + @Test + public void getViewClientExposesSevenClinicalViews() throws Exception { + Assert.assertEquals(7, GET_VIEW_REQUEST_TYPES.size()); + Map, Method> bySecondArg = new LinkedHashMap<>(); + for (Method method : GetViewClient.class.getDeclaredMethods()) { + if (!"getView".equals(method.getName()) || method.getParameterCount() != 2) { + continue; + } + Class[] params = method.getParameterTypes(); + if (!MHRHeader.class.equals(params[0]) || Object.class.equals(params[1])) { + continue; + } + bySecondArg.put(params[1], method); + } + for (String typeName : GET_VIEW_REQUEST_TYPES) { + Class viewType = Class.forName(typeName); + Assert.assertTrue("GetViewClient missing getView(" + typeName + ")", + bySecondArg.containsKey(viewType)); + } + } +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MhrWsdlArtifactSmokeTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MhrWsdlArtifactSmokeTest.java new file mode 100644 index 0000000..1f044b3 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/MhrWsdlArtifactSmokeTest.java @@ -0,0 +1,20 @@ +package au.gov.nehta.vendorlibrary.mhr.test.unittests; + +import static org.junit.Assert.assertTrue; + +import jakarta.xml.ws.Service; +import org.junit.Test; + +/** + * Smoke test: generated MHR SOAP types are on the compile classpath via + * {@code mhr-wsdl}. + */ +public class MhrWsdlArtifactSmokeTest { + + @Test + public void mhrProfileServiceTypeIsOnClasspath() throws Exception { + Class serviceType = Class.forName( + "au.net.electronichealth.ns.mhr.b2b.svc.mhrprofile._1.MHRProfileService"); + assertTrue(Service.class.isAssignableFrom(serviceType)); + } +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/OIDUtilTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/OIDUtilTest.java similarity index 95% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/OIDUtilTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/OIDUtilTest.java index 9884b1d..2c756e8 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/OIDUtilTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/OIDUtilTest.java @@ -12,9 +12,9 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.OIDUtil; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.OIDUtil; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/ReubenArchitectTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/ReubenArchitectTest.java similarity index 66% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/ReubenArchitectTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/ReubenArchitectTest.java index 3b83ec4..8ab12a0 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/ReubenArchitectTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/ReubenArchitectTest.java @@ -11,12 +11,12 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; +import au.gov.nehta.vendorlibrary.mhr.clients.recordaccess.DoesMHRExistClient; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.net.electronichealth.ns.mhr.xsd.interfaces.mhrprofile._1.DoesMHRExistResponse; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -24,12 +24,12 @@ public class ReubenArchitectTest { - private DoesPCEHRExistClient client; + private DoesMHRExistClient client; @Before public final void setUp() throws Exception { AllTests_Reuben.setUp(); - client = new DoesPCEHRExistClient( + client = new DoesMHRExistClient( AllTests_Reuben.getSslSocketFactory(), AllTests_Reuben.getCertificate(), AllTests_Reuben.getPrivateKey(), @@ -46,8 +46,8 @@ public final void tearDown() throws Exception { @Test public void test_030() throws Exception { - DoesPCEHRExistResponse response = client.doesPCEHRExist(AllTests_Reuben.getDefaultRequest()); + DoesMHRExistResponse response = client.doesPCEHRExist(AllTests_Reuben.getDefaultRequest()); Assert.assertTrue(response.isPCEHRExists()); - Assert.assertEquals(DoesPCEHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); + Assert.assertEquals(DoesMHRExistResponse.AccessCodeRequired.ACCESS_GRANTED, response.getAccessCodeRequired()); } } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/SigTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/SigTest.java similarity index 93% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/SigTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/SigTest.java index 547706c..889bbfe 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/SigTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/SigTest.java @@ -12,12 +12,12 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackageExtractionException; import au.gov.nehta.vendorlibrary.common.security.SignedContainerProfileUtil; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XMLNamespaces; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XMLNamespaces; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; import au.gov.nehta.xsp.*; import org.apache.commons.lang3.Validate; import org.w3c.dom.Document; @@ -25,7 +25,7 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -89,3 +89,4 @@ private static Element getFirstElementFromNodeList(NodeList nodeList) { } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/VendorEnd2End.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/VendorEnd2End.java similarity index 85% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/VendorEnd2End.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/VendorEnd2End.java index ed7d220..21aa7ef 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/VendorEnd2End.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/VendorEnd2End.java @@ -12,28 +12,28 @@ * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.FormatCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.HealthcareFacilityTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.PracticeSettingTypeCodes; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.util.FileUtils; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.GetDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.RemoveDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.clients.documentexchange.UploadDocumentClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.FormatCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.HealthcareFacilityTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.PracticeSettingTypeCodes; +import au.gov.nehta.vendorlibrary.mhr.clients.common.util.FileUtils; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.GetDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.RemoveDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.clients.documentexchange.UploadDocumentClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; -import au.net.electronichealth.ns.pcehr.svc.removedocument._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocument; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; +import au.net.electronichealth.ns.mhr.svc.removedocument._1.StandardErrorMsg; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocument; +import au.net.electronichealth.ns.mhr.xsd.interfaces.removedocument._1.RemoveDocumentResponse; import ihe.iti.xds_b._2007.RetrieveDocumentSetRequest; import ihe.iti.xds_b._2007.RetrieveDocumentSetResponse; import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryError; @@ -53,7 +53,7 @@ import javax.xml.transform.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -75,7 +75,7 @@ public class VendorEnd2End { private Holder currentId; private byte[] rootDocument; private PersonNameType approverName; - private static PCEHRHeader request; + private static MHRHeader request; @BeforeClass public static void initialSetup() throws Exception { @@ -106,10 +106,10 @@ public boolean verify(String s, SSLSession sslSession) { request = MessageComponents.createRequest ( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Dr. Todd Bagshaw", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Dr. Todd Bagshaw", false), "8003602348687602", MessageComponents.createProductType("NeHTA", "testHarness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003620000020052", "Bay Hill Hospital", null) ); @@ -274,7 +274,7 @@ private SubmissionSet createPackageWithAttachments(final byte[] rootDocument) th return subsetBuilder.build(); } - private static RemoveDocumentResponse removeDoc(PCEHRHeader commonHeader, String docId) throws GeneralSecurityException, StandardErrorMsg { + private static RemoveDocumentResponse removeDoc(MHRHeader commonHeader, String docId) throws GeneralSecurityException, StandardErrorMsg { RemoveDocumentClient removeClient = new RemoveDocumentClient( sslSocketFactory, SecurityUtil.getCertificate(), @@ -286,3 +286,4 @@ private static RemoveDocumentResponse removeDoc(PCEHRHeader commonHeader, String return removeClient.removeDocument(commonHeader, docId, RemoveDocument.DocumentRemovalReason.WITHDRAWN); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/WsdlsCodegenToolingTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/WsdlsCodegenToolingTest.java similarity index 94% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/WsdlsCodegenToolingTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/WsdlsCodegenToolingTest.java index 1f4ef8f..5ede112 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/WsdlsCodegenToolingTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/WsdlsCodegenToolingTest.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; +package au.gov.nehta.vendorlibrary.mhr.test.unittests; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -35,7 +35,7 @@ private static Path wsdlsDir() { @Test public void antToolingJarsPresentWithoutMetro() throws IOException { Path lib = wsdlsDir().resolve("lib/provided"); - assertTrue("Missing " + lib + " — run: cd wsdls && ./sync-lib.ps1", Files.isDirectory(lib)); + assertTrue("Missing " + lib + " - run: cd wsdls && ./sync-lib.ps1", Files.isDirectory(lib)); List jars; try (Stream stream = Files.list(lib)) { @@ -70,7 +70,7 @@ public void wsdlTreeAndAntBuildFilesReadyForCodegen() { assertTrue(wsdlsDir().resolve("ee4j-jaxws-lib-pom.xml").toFile().isFile()); assertTrue(wsdlsDir().resolve("src/main/java/au/gov/nehta/schema/DateAdapter.java").toFile().isFile()); assertTrue(wsdlsDir() - .resolve("src/main/resources/wsdl/External/B2B_PCEHRProfile.wsdl") + .resolve("src/main/resources/wsdl/External/B2B_MHRProfile.wsdl") .toFile() .isFile()); } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/views/GetRepresentativeListClientTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/views/GetRepresentativeListClientTest.java similarity index 71% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/views/GetRepresentativeListClientTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/views/GetRepresentativeListClientTest.java index b6741de..4ba3c17 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/views/GetRepresentativeListClientTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/unittests/views/GetRepresentativeListClientTest.java @@ -1,12 +1,12 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests.views; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetRepresentativeListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Endpoints; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.Logging; -import au.gov.nehta.vendorlibrary.pcehr.test.utils.SecurityUtil; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; +package au.gov.nehta.vendorlibrary.mhr.test.unittests.views; + +import au.gov.nehta.vendorlibrary.mhr.clients.view.GetRepresentativeListClient; +import au.gov.nehta.vendorlibrary.mhr.sample.common.util.MessageComponents; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Endpoints; +import au.gov.nehta.vendorlibrary.mhr.test.utils.Logging; +import au.gov.nehta.vendorlibrary.mhr.test.utils.SecurityUtil; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; import org.junit.*; import javax.net.ssl.HostnameVerifier; @@ -62,18 +62,18 @@ public void testGetRepresentativeListResponse() throws Exception { GetRepresentativeListResponse response = client.getRepresentativeList( // MessageComponents.createRequest // ( -// MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166674595", null, "Anthony TUCKER", false), +// MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166674595", null, "Anthony TUCKER", false), // "8003602348687602", // MessageComponents.createProductType("NEHTA", "testHarness", "1.0", "Windows 7 - Java"), -// PCEHRHeader.ClientSystemType.CIS, +// MHRHeader.ClientSystemType.CIS, // MessageComponents.createAccessingOrganisation("8003628233352432", "2", null) // ) MessageComponents.createRequest( - MessageComponents.createUser(PCEHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), + MessageComponents.createUser(MHRHeader.User.IDType.HPII, "8003619166668209", null, "Anthony TUCKER", false), "8003608500011184", MessageComponents.createProductType("NEHTA", "testHarness", "1.0", "Windows 7 - Java"), - PCEHRHeader.ClientSystemType.CIS, + MHRHeader.ClientSystemType.CIS, MessageComponents.createAccessingOrganisation("8003628233352432", "2", null) ) diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/AuthorTest.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/AuthorTest.java similarity index 96% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/AuthorTest.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/AuthorTest.java index fbc7805..82f0767 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/AuthorTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/AuthorTest.java @@ -1,6 +1,6 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.Author; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.Author; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/BadValues.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/BadValues.java similarity index 87% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/BadValues.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/BadValues.java index 38d065c..e833550 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/BadValues.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/BadValues.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; public class BadValues { /** diff --git a/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/DateFormats.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/DateFormats.java new file mode 100644 index 0000000..83b52af --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/DateFormats.java @@ -0,0 +1,5 @@ +package au.gov.nehta.vendorlibrary.mhr.test.utils; + +public enum DateFormats { + +} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/DefaultValues.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/DefaultValues.java similarity index 65% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/DefaultValues.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/DefaultValues.java index 6f69285..4b152b1 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/DefaultValues.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/DefaultValues.java @@ -1,12 +1,12 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; public class DefaultValues { /** * Default test values. */ - public static final PCEHRHeader.User.IDType ID_TYPE = PCEHRHeader.User.IDType.HPII; + public static final MHRHeader.User.IDType ID_TYPE = MHRHeader.User.IDType.HPII; public static final String ID = "8003630000011111"; public static final String ROLE = "Default Role"; public static final String USER_NAME = "Default User Name"; @@ -14,9 +14,9 @@ public class DefaultValues { public static final String IHI_NUMBER = "8003600300001119"; public static final String VENDOR = "Vendor X"; public static final String PRODUCT_NAME = "Product Name"; - public static final String PRODUCT_VERSION = "Version 1.2.1"; + public static final String PRODUCT_VERSION = "Version 17.0.0"; public static final String PLATFORM = "Platform X"; - public static final PCEHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE = PCEHRHeader.ClientSystemType.CPP; + public static final MHRHeader.ClientSystemType CLIENT_SYSTEM_TYPE = MHRHeader.ClientSystemType.CPP; public static final String ORGANISATION_ID = "8003620000020052"; public static final String ORGANISATION_NAME = "Organisation X"; public static final String ALTERNATE_ORGANISATION_NAME = "Organisation X-2"; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/Endpoints.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/Endpoints.java similarity index 99% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/Endpoints.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/Endpoints.java index 4e9a36c..c95f936 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/Endpoints.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/Endpoints.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; public final class Endpoints { diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/Logging.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/Logging.java similarity index 94% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/Logging.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/Logging.java index a511b5b..8327430 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/Logging.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/Logging.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; public final class Logging { public static final boolean DOES_PCEHR_EXIST = true; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SecurityConstants.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SecurityConstants.java similarity index 97% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SecurityConstants.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SecurityConstants.java index f3b349d..4a9a6b5 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SecurityConstants.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SecurityConstants.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; /** * diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SecurityUtil.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SecurityUtil.java similarity index 99% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SecurityUtil.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SecurityUtil.java index 1ffb5ba..a969978 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SecurityUtil.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SecurityUtil.java @@ -11,7 +11,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; import au.gov.nehta.vendorlibrary.common.security.KeystoreUtil; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SpecialValues.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SpecialValues.java similarity index 88% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SpecialValues.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SpecialValues.java index 86aaab9..689d31c 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/SpecialValues.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/SpecialValues.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; public class SpecialValues { /** diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestConstants.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestConstants.java similarity index 75% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestConstants.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestConstants.java index 2c334e0..74fbb17 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestConstants.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestConstants.java @@ -1,4 +1,4 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; public class TestConstants { public static final String TEST_DATA_1_6 = "./src/test/resources/1.6.csv"; diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestDataFactory.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestDataFactory.java similarity index 85% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestDataFactory.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestDataFactory.java index 5a73dd8..2ae296a 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestDataFactory.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestDataFactory.java @@ -11,15 +11,15 @@ * License for the specific language governing permissions and limitations * under the License. */ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.type.SubmissionMetadata; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader.AccessingOrganisation; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader.ClientSystemType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader.ProductType; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader.User; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader.User.IDType; +import au.gov.nehta.vendorlibrary.mhr.clients.common.type.SubmissionMetadata; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader.AccessingOrganisation; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader.ClientSystemType; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader.ProductType; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader.User; +import au.net.electronichealth.ns.mhr.xsd.common.commoncoreelements._1.MHRHeader.User.IDType; import org.apache.commons.lang3.time.DateUtils; import java.util.Calendar; @@ -30,7 +30,7 @@ */ public final class TestDataFactory { - public static PCEHRHeader createValidPCEHRHeader() { + public static MHRHeader createValidMHRHeader() { User user = new User(); user.setIDType(IDType.HPII); user.setID("{ID}"); @@ -47,7 +47,7 @@ public static PCEHRHeader createValidPCEHRHeader() { org.setOrganisationName("{OrganisationName}"); org.setAlternateOrganisationName("{AlternateOrganisationName}"); - PCEHRHeader header = new PCEHRHeader(); + MHRHeader header = new MHRHeader(); header.setIhiNumber("{IHINumber}"); header.setClientSystemType(ClientSystemType.OTHER); header.setUser(user); diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestUtils.java b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestUtils.java similarity index 95% rename from src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestUtils.java rename to src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestUtils.java index 5b8e080..e00b019 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/TestUtils.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/mhr/test/utils/TestUtils.java @@ -1,9 +1,9 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; +package au.gov.nehta.vendorlibrary.mhr.test.utils; import au.gov.nehta.vendorlibrary.clinicalpackage.core.SubmissionSet; import au.gov.nehta.vendorlibrary.clinicalpackage.util.PackagingUtility; import au.gov.nehta.vendorlibrary.clinicalpackage.util.SignatureGenerationException; -import au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.XPathExpressions; +import au.gov.nehta.vendorlibrary.mhr.clients.common.constant.XPathExpressions; import au.net.electronichealth.ns.cdapackage.xsd.esignature._2012.PersonNameType; import org.w3c.dom.Document; import org.w3c.dom.NodeList; @@ -15,7 +15,7 @@ import javax.xml.transform.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.ws.Holder; +import jakarta.xml.ws.Holder; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -98,3 +98,4 @@ public static byte[] modifyDocId(byte[] templateContent, Holder currentI return out.toByteArray(); } } + diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/DoesPCEHRExistSample.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/DoesPCEHRExistSample.java deleted file mode 100644 index c079cc4..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/recordaccess/DoesPCEHRExistSample.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2012 NEHTA - * - * Licensed under the NEHTA Open Source (Apache) License; you may not use this - * file except in compliance with the License. A copy of the License is in the - * 'LICENSE.txt' file, which should be provided with this work. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package au.gov.nehta.vendorlibrary.pcehr.sample.recordaccess; - -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.clients.recordaccess.DoesPCEHRExistClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.pcehrprofile._1.DoesPCEHRExistResponse; - -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSocketFactory; -import java.io.IOException; -import java.security.GeneralSecurityException; - -/** - * An example class showing usage of the Does PCEHR Exist web service client. - */ -public final class DoesPCEHRExistSample { - - private DoesPCEHRExistSample() { - - } - - public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - - DoesPCEHRExistClient client; - - // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. - SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); - HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory); - - // For testing purposes. - System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); - - // Instantiate client, providing: - // - // * socket factory; - // * endpoint URI string; and - // * set logging on/off. - client = new DoesPCEHRExistClient( - sslSocketFactory, - SecurityUtil.getCertificate(), - SecurityUtil.getPrivateKey(), - SampleEndpoints.DOES_PCEHR_EXIST, - true - ); - - // Create a sample PCEHR header consisting of: - // - // * User; - // * IHI number; - // * Product type; - // * Client system type; and - // * Accessing organisation. - - // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( - SampleValues.USER_ID_TYPE, - SampleValues.USER_ID, - SampleValues.USER_ROLE, - SampleValues.USER_NAME, - SampleValues.USER_USE_ROLE_FOR_AUDIT - ); - - // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( - SampleValues.PRODUCT_TYPE_VENDOR, - SampleValues.PRODUCT_NAME, - SampleValues.PRODUCT_VERSION, - SampleValues.PRODUCT_PLATFORM - ); - - // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( - SampleValues.ACCESSING_ORGANISATION_ID, - SampleValues.ACCESSING_ORGANISATION_NAME, - SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME - ); - - // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( - user, - SampleValues.IHI_NUMBER, - productType, - SampleValues.CLIENT_SYSTEM_TYPE_CIS, - accessingOrganisation - ); - - // Call operation. - DoesPCEHRExistResponse response = client.doesPCEHRExist(commonHeader); - - // Process response. - System.out.println("PCEHR Exists: " + response.isPCEHRExists()); - System.out.println("Access Code Required: " + response.getAccessCodeRequired()); - } -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetRepresentativeListSample.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetRepresentativeListSample.java deleted file mode 100644 index ea5bb65..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/sample/view/GetRepresentativeListSample.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2012 NEHTA - * - * Licensed under the NEHTA Open Source (Apache) License; you may not use this - * file except in compliance with the License. A copy of the License is in the - * 'LICENSE.txt' file, which should be provided with this work. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package au.gov.nehta.vendorlibrary.pcehr.sample.view; - -import au.gov.nehta.vendorlibrary.pcehr.clients.view.GetRepresentativeListClient; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleEndpoints; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.constants.SampleValues; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.MessageComponents; -import au.gov.nehta.vendorlibrary.pcehr.sample.common.util.SecurityUtil; -import au.net.electronichealth.ns.pcehr.svc.getrepresentativelist._1.StandardErrorMsg; -import au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader; -import au.net.electronichealth.ns.pcehr.xsd.interfaces.getrepresentativelist._1.GetRepresentativeListResponse; -import com.sun.xml.ws.developer.JAXWSProperties; - -import javax.net.ssl.SSLSocketFactory; -import java.io.IOException; -import java.security.GeneralSecurityException; - -/** - * An example class showing usage of the Get Representative List web service client. - */ -public class GetRepresentativeListSample { - - private GetRepresentativeListSample() { - } - - public static void main(String[] args) throws IOException, GeneralSecurityException, StandardErrorMsg { - - GetRepresentativeListClient client; - - // Sets the newly created sslsocketfactory as the default for all instances of the HttpsURLConnection class. - SSLSocketFactory sslSocketFactory = SecurityUtil.getSslSocketFactory(); - - // For testing purposes. - System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); - - // Instantiate client, providing: - // - // * socket factory; - // * endpoint URI string; and - // * set logging on/off. - client = new GetRepresentativeListClient( - sslSocketFactory, - SecurityUtil.getCertificate(), - SecurityUtil.getPrivateKey(), - SampleEndpoints.GET_REPRESENTATIVE_LIST, - true); - - - //allow SSL connections to be set on a per client basis - client.setProperty(JAXWSProperties.SSL_SOCKET_FACTORY, sslSocketFactory); - - - // Create a sample user, using helper method. - PCEHRHeader.User user = MessageComponents.createUser( - SampleValues.USER_ID_TYPE, - SampleValues.USER_ID, - SampleValues.USER_ROLE, - SampleValues.USER_NAME, - SampleValues.USER_USE_ROLE_FOR_AUDIT - ); - - // Create a sample product type, using helper method. - PCEHRHeader.ProductType productType = MessageComponents.createProductType( - SampleValues.PRODUCT_TYPE_VENDOR, - SampleValues.PRODUCT_NAME, - SampleValues.PRODUCT_VERSION, - SampleValues.PRODUCT_PLATFORM - ); - - // Create a sample accessing organisation, using helper method. - PCEHRHeader.AccessingOrganisation accessingOrganisation = MessageComponents.createAccessingOrganisation( - SampleValues.ACCESSING_ORGANISATION_ID, - SampleValues.ACCESSING_ORGANISATION_NAME, - SampleValues.ACCESSING_ORGANISATION_ALTERNATE_NAME - ); - - // Create a sample PCEHR request header, using helper method. - PCEHRHeader commonHeader = MessageComponents.createRequest( - user, - SampleValues.IHI_NUMBER, - productType, - SampleValues.CLIENT_SYSTEM_TYPE_CIS, - accessingOrganisation - ); - - // Call operation - get all PCEHR documents associated with given IHI. - GetRepresentativeListResponse response = client.getRepresentativeList(commonHeader); - - // Process response. - System.out.println("Response Status: " + response.getResponseStatus().getCode()); - - // Get list of documents. - GetRepresentativeListResponse.PCEHRRecord.RepresentativeList representativeList = response.getPCEHRRecord().getRepresentativeList(); - - // Get document status. - System.out.println("Representative List Size: " + representativeList.getRepresentatives().size()); - } -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/DocumentExchangeSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/DocumentExchangeSuite.java deleted file mode 100644 index 1e613f3..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/DocumentExchangeSuite.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.suites; - - -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange.GetDocumentTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange.RemoveDocumentTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange.UploadDocumentClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.documentexchange.UploadDocumentMetadataClientTest; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - UploadDocumentClientTest.class, - UploadDocumentMetadataClientTest.class, - RemoveDocumentTest.class, - GetDocumentTest.class -}) - -public class DocumentExchangeSuite { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/RecordAccessSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/RecordAccessSuite.java deleted file mode 100644 index 17dd737..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/RecordAccessSuite.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.suites; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.recordaccess.DoesPCHERExistClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.recordaccess.GainPCEHRAccessClientTest; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - GainPCEHRAccessClientTest.class, - DoesPCHERExistClientTest.class -}) - -public class RecordAccessSuite { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/ViewSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/ViewSuite.java deleted file mode 100644 index 6cb32b0..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120718_regression/suites/ViewSuite.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.suites; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view.GetAuditViewClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view.GetChangeHistoryViewClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view.GetDocumentListClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120718_regression.tests.view.GetRepresentativeListClientTest; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - GetDocumentListClientTest.class, - GetAuditViewClientTest.class, - GetChangeHistoryViewClientTest.class, - GetRepresentativeListClientTest.class -}) - -public class ViewSuite { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/DocumentExchangeSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/DocumentExchangeSuite_NOC.java deleted file mode 100644 index e4ea639..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/DocumentExchangeSuite_NOC.java +++ /dev/null @@ -1,21 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.suites; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange.GeneralTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange.GetDocumentTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange.RemoveDocumentTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange.UploadDocumentMetadataClient_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.documentexchange.UploadDocumentClientTest_NOC; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - UploadDocumentClientTest_NOC.class, - GetDocumentTest_NOC.class, - RemoveDocumentTest_NOC.class, - UploadDocumentMetadataClient_NOC.class, - GeneralTest_NOC.class -}) - -public class DocumentExchangeSuite_NOC { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/RecordAccessSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/RecordAccessSuite_NOC.java deleted file mode 100644 index 61adaeb..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/RecordAccessSuite_NOC.java +++ /dev/null @@ -1,18 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.suites; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.recordaccess.AllRecordAccessTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.recordaccess.DoesPCHERExistClientTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.recordaccess.GainPCEHRAccessClientTest_NOC; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - DoesPCHERExistClientTest_NOC.class, - GainPCEHRAccessClientTest_NOC.class, - AllRecordAccessTest_NOC.class -}) - -public class RecordAccessSuite_NOC { - -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/TemplateSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/TemplateSuite_NOC.java deleted file mode 100644 index 2886c7e..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/TemplateSuite_NOC.java +++ /dev/null @@ -1,16 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.suites; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.template.GetTemplateClientTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.template.SearchTemplateClientTest_NOC; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - GetTemplateClientTest_NOC.class, - SearchTemplateClientTest_NOC.class -}) - -public class TemplateSuite_NOC { -} - diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/ViewSuite_NOC.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/ViewSuite_NOC.java deleted file mode 100644 index b3ed2d2..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120724_noc/suites/ViewSuite_NOC.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.suites; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view.AllViewTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view.GetAuditViewClientTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view.GetChangeHistoryViewClientTest_NOC; -import au.gov.nehta.vendorlibrary.pcehr.test._20120724_noc.tests.view.GetDocumentListClientTest_NOC; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - GetChangeHistoryViewClientTest_NOC.class, - GetAuditViewClientTest_NOC.class, - GetDocumentListClientTest_NOC.class, - AllViewTest_NOC.class -}) - -public class ViewSuite_NOC { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/DocumentExchangeSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/DocumentExchangeSuite.java deleted file mode 100644 index 0e6e556..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/DocumentExchangeSuite.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.suites; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange.GetDocumentTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange.RemoveDocumentTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange.UploadDocumentClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.documentexchange.UploadDocumentMetadataClientTest; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - UploadDocumentClientTest.class, - UploadDocumentMetadataClientTest.class, - RemoveDocumentTest.class, - GetDocumentTest.class -}) - -public class DocumentExchangeSuite { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/RecordAccessSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/RecordAccessSuite.java deleted file mode 100644 index b8f7bea..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/RecordAccessSuite.java +++ /dev/null @@ -1,15 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.suites; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.recordaccess.GainPCEHRAccessClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test.unittests.ReubenArchitectTest; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - GainPCEHRAccessClientTest.class, - ReubenArchitectTest.class -}) - -public class RecordAccessSuite { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/ViewSuite.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/ViewSuite.java deleted file mode 100644 index 97cff29..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/_20120801_pm1/suites/ViewSuite.java +++ /dev/null @@ -1,20 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.suites; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view.GetAuditViewClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view.GetChangeHistoryViewClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view.GetDocumentListClientTest; -import au.gov.nehta.vendorlibrary.pcehr.test._20120801_pm1.tests.view.GetRepresentativeListClientTest; - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - GetDocumentListClientTest.class, - GetAuditViewClientTest.class, - GetChangeHistoryViewClientTest.class, - GetRepresentativeListClientTest.class -}) - -public class ViewSuite { -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/PcehrWsdlArtifactSmokeTest.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/PcehrWsdlArtifactSmokeTest.java deleted file mode 100644 index fa3f360..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/unittests/PcehrWsdlArtifactSmokeTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.unittests; - -import static org.junit.Assert.assertTrue; - -import javax.xml.ws.Service; -import org.junit.Test; - -/** - * Smoke test: generated PCEHR SOAP types are on the compile classpath via pcehr-compiled-wsdl. - */ -public class PcehrWsdlArtifactSmokeTest { - - @Test - public void pcehrProfileServiceTypeIsOnClasspath() throws Exception { - Class serviceType = Class.forName( - "au.net.electronichealth.ns.pcehr.b2b.svc.pcehrprofile._1.PCEHRProfileService"); - assertTrue(Service.class.isAssignableFrom(serviceType)); - } -} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/DateFormats.java b/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/DateFormats.java deleted file mode 100644 index 19994b4..0000000 --- a/src/test/java/au/gov/nehta/vendorlibrary/pcehr/test/utils/DateFormats.java +++ /dev/null @@ -1,5 +0,0 @@ -package au.gov.nehta.vendorlibrary.pcehr.test.utils; - -public enum DateFormats { - -} diff --git a/wsdls/.project b/wsdls/.project index b24d18b..5b5e7db 100644 --- a/wsdls/.project +++ b/wsdls/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1787637644312 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/wsdls/build.properties b/wsdls/build.properties index 55d5189..5fe6bca 100644 --- a/wsdls/build.properties +++ b/wsdls/build.properties @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. -project.name=nehta-vendorlibrary-java-pcehr-compiled-wsdl -project.title=pcehr-compiled-wsdl -project.version=2.4.4 +project.name=nehta-vendorlibrary-java-mhr-wsdl +project.title=mhr-wsdl +project.version=17.0.0 project.root.dir=${basedir} dist.name=${project.name}-${project.version} diff --git a/wsdls/build.xml b/wsdls/build.xml index b5f83ad..c3fc7ee 100644 --- a/wsdls/build.xml +++ b/wsdls/build.xml @@ -129,7 +129,7 @@ + binding.files="GlobalBindings.jxb, MHR_CommonTypes.xsd.jxb, ${relative.wsdl.file}.jxb"/> @@ -141,7 +141,7 @@ - + diff --git a/wsdls/ee4j-jaxws-lib-pom.xml b/wsdls/ee4j-jaxws-lib-pom.xml index e866a67..a7bf975 100644 --- a/wsdls/ee4j-jaxws-lib-pom.xml +++ b/wsdls/ee4j-jaxws-lib-pom.xml @@ -13,7 +13,7 @@ - 2.3.7 + 4.0.5 1.0b3 UTF-8 ${encoding} diff --git a/wsdls/lib/provided/FastInfoset-1.2.18.jar b/wsdls/lib/provided/FastInfoset-1.2.18.jar deleted file mode 100644 index ffc78ce..0000000 Binary files a/wsdls/lib/provided/FastInfoset-1.2.18.jar and /dev/null differ diff --git a/wsdls/lib/provided/FastInfoset-2.1.1.jar b/wsdls/lib/provided/FastInfoset-2.1.1.jar new file mode 100644 index 0000000..a3558eb Binary files /dev/null and b/wsdls/lib/provided/FastInfoset-2.1.1.jar differ diff --git a/wsdls/lib/provided/angus-activation-2.0.3.jar b/wsdls/lib/provided/angus-activation-2.0.3.jar new file mode 100644 index 0000000..361060a Binary files /dev/null and b/wsdls/lib/provided/angus-activation-2.0.3.jar differ diff --git a/wsdls/lib/provided/angus-mail-2.0.5.jar b/wsdls/lib/provided/angus-mail-2.0.5.jar new file mode 100644 index 0000000..2f37c42 Binary files /dev/null and b/wsdls/lib/provided/angus-mail-2.0.5.jar differ diff --git a/wsdls/lib/provided/asm-9.7.1.jar b/wsdls/lib/provided/asm-9.7.1.jar new file mode 100644 index 0000000..fe3d001 Binary files /dev/null and b/wsdls/lib/provided/asm-9.7.1.jar differ diff --git a/wsdls/lib/provided/asm-analysis-9.7.1.jar b/wsdls/lib/provided/asm-analysis-9.7.1.jar new file mode 100644 index 0000000..5267700 Binary files /dev/null and b/wsdls/lib/provided/asm-analysis-9.7.1.jar differ diff --git a/wsdls/lib/provided/asm-tree-9.7.1.jar b/wsdls/lib/provided/asm-tree-9.7.1.jar new file mode 100644 index 0000000..a1004da Binary files /dev/null and b/wsdls/lib/provided/asm-tree-9.7.1.jar differ diff --git a/wsdls/lib/provided/asm-util-9.7.1.jar b/wsdls/lib/provided/asm-util-9.7.1.jar new file mode 100644 index 0000000..5fad1cb Binary files /dev/null and b/wsdls/lib/provided/asm-util-9.7.1.jar differ diff --git a/wsdls/lib/provided/gmbal-api-only-4.0.3.jar b/wsdls/lib/provided/gmbal-api-only-4.0.3.jar deleted file mode 100644 index b0ce7be..0000000 Binary files a/wsdls/lib/provided/gmbal-api-only-4.0.3.jar and /dev/null differ diff --git a/wsdls/lib/provided/gmbal-api-only-4.1.1.jar b/wsdls/lib/provided/gmbal-api-only-4.1.1.jar new file mode 100644 index 0000000..5a24505 Binary files /dev/null and b/wsdls/lib/provided/gmbal-api-only-4.1.1.jar differ diff --git a/wsdls/lib/provided/jakarta.activation-1.2.2.jar b/wsdls/lib/provided/jakarta.activation-1.2.2.jar deleted file mode 100644 index bddea49..0000000 Binary files a/wsdls/lib/provided/jakarta.activation-1.2.2.jar and /dev/null differ diff --git a/wsdls/lib/provided/jakarta.activation-api-2.1.4.jar b/wsdls/lib/provided/jakarta.activation-api-2.1.4.jar new file mode 100644 index 0000000..63caeb8 Binary files /dev/null and b/wsdls/lib/provided/jakarta.activation-api-2.1.4.jar differ diff --git a/wsdls/lib/provided/jakarta.annotation-api-1.3.5.jar b/wsdls/lib/provided/jakarta.annotation-api-1.3.5.jar deleted file mode 100644 index 606d992..0000000 Binary files a/wsdls/lib/provided/jakarta.annotation-api-1.3.5.jar and /dev/null differ diff --git a/wsdls/lib/provided/jakarta.annotation-api-3.0.0.jar b/wsdls/lib/provided/jakarta.annotation-api-3.0.0.jar new file mode 100644 index 0000000..34c1d43 Binary files /dev/null and b/wsdls/lib/provided/jakarta.annotation-api-3.0.0.jar differ diff --git a/wsdls/lib/provided/jakarta.jws-api-2.1.0.jar b/wsdls/lib/provided/jakarta.jws-api-2.1.0.jar deleted file mode 100644 index 00a584c..0000000 Binary files a/wsdls/lib/provided/jakarta.jws-api-2.1.0.jar and /dev/null differ diff --git a/wsdls/lib/provided/jakarta.mail-1.6.7.jar b/wsdls/lib/provided/jakarta.mail-1.6.7.jar deleted file mode 100644 index 2fbf851..0000000 Binary files a/wsdls/lib/provided/jakarta.mail-1.6.7.jar and /dev/null differ diff --git a/wsdls/lib/provided/jakarta.mail-api-2.1.5.jar b/wsdls/lib/provided/jakarta.mail-api-2.1.5.jar new file mode 100644 index 0000000..a605f43 Binary files /dev/null and b/wsdls/lib/provided/jakarta.mail-api-2.1.5.jar differ diff --git a/wsdls/lib/provided/jakarta.xml.bind-api-2.3.3.jar b/wsdls/lib/provided/jakarta.xml.bind-api-2.3.3.jar deleted file mode 100644 index b8c7dc1..0000000 Binary files a/wsdls/lib/provided/jakarta.xml.bind-api-2.3.3.jar and /dev/null differ diff --git a/wsdls/lib/provided/jakarta.xml.bind-api-4.0.4.jar b/wsdls/lib/provided/jakarta.xml.bind-api-4.0.4.jar new file mode 100644 index 0000000..d893d5e Binary files /dev/null and b/wsdls/lib/provided/jakarta.xml.bind-api-4.0.4.jar differ diff --git a/wsdls/lib/provided/jakarta.xml.soap-api-1.4.2.jar b/wsdls/lib/provided/jakarta.xml.soap-api-1.4.2.jar deleted file mode 100644 index 83afa60..0000000 Binary files a/wsdls/lib/provided/jakarta.xml.soap-api-1.4.2.jar and /dev/null differ diff --git a/wsdls/lib/provided/jakarta.xml.soap-api-3.0.2.jar b/wsdls/lib/provided/jakarta.xml.soap-api-3.0.2.jar new file mode 100644 index 0000000..6b51f28 Binary files /dev/null and b/wsdls/lib/provided/jakarta.xml.soap-api-3.0.2.jar differ diff --git a/wsdls/lib/provided/jakarta.xml.ws-api-2.3.3.jar b/wsdls/lib/provided/jakarta.xml.ws-api-2.3.3.jar deleted file mode 100644 index a9513d6..0000000 Binary files a/wsdls/lib/provided/jakarta.xml.ws-api-2.3.3.jar and /dev/null differ diff --git a/wsdls/lib/provided/jakarta.xml.ws-api-4.0.3.jar b/wsdls/lib/provided/jakarta.xml.ws-api-4.0.3.jar new file mode 100644 index 0000000..174e0ab Binary files /dev/null and b/wsdls/lib/provided/jakarta.xml.ws-api-4.0.3.jar differ diff --git a/wsdls/lib/provided/jaxb-core-4.0.6.jar b/wsdls/lib/provided/jaxb-core-4.0.6.jar new file mode 100644 index 0000000..45af052 Binary files /dev/null and b/wsdls/lib/provided/jaxb-core-4.0.6.jar differ diff --git a/wsdls/lib/provided/jaxb-impl-2.3.9.jar b/wsdls/lib/provided/jaxb-impl-2.3.9.jar deleted file mode 100644 index c706ab4..0000000 Binary files a/wsdls/lib/provided/jaxb-impl-2.3.9.jar and /dev/null differ diff --git a/wsdls/lib/provided/jaxb-impl-4.0.6.jar b/wsdls/lib/provided/jaxb-impl-4.0.6.jar new file mode 100644 index 0000000..ae8a634 Binary files /dev/null and b/wsdls/lib/provided/jaxb-impl-4.0.6.jar differ diff --git a/wsdls/lib/provided/jaxb-jxc-2.3.9.jar b/wsdls/lib/provided/jaxb-jxc-2.3.9.jar deleted file mode 100644 index 2f1acf6..0000000 Binary files a/wsdls/lib/provided/jaxb-jxc-2.3.9.jar and /dev/null differ diff --git a/wsdls/lib/provided/jaxb-jxc-4.0.6.jar b/wsdls/lib/provided/jaxb-jxc-4.0.6.jar new file mode 100644 index 0000000..10cc0e3 Binary files /dev/null and b/wsdls/lib/provided/jaxb-jxc-4.0.6.jar differ diff --git a/wsdls/lib/provided/jaxb-xjc-2.3.9.jar b/wsdls/lib/provided/jaxb-xjc-2.3.9.jar deleted file mode 100644 index 693b1d9..0000000 Binary files a/wsdls/lib/provided/jaxb-xjc-2.3.9.jar and /dev/null differ diff --git a/wsdls/lib/provided/jaxb-xjc-4.0.6.jar b/wsdls/lib/provided/jaxb-xjc-4.0.6.jar new file mode 100644 index 0000000..9e89ac7 Binary files /dev/null and b/wsdls/lib/provided/jaxb-xjc-4.0.6.jar differ diff --git a/wsdls/lib/provided/jaxws-rt-2.3.7.jar b/wsdls/lib/provided/jaxws-rt-2.3.7.jar deleted file mode 100644 index bb51e87..0000000 Binary files a/wsdls/lib/provided/jaxws-rt-2.3.7.jar and /dev/null differ diff --git a/wsdls/lib/provided/jaxws-rt-4.0.4.jar b/wsdls/lib/provided/jaxws-rt-4.0.4.jar new file mode 100644 index 0000000..9d82e6f Binary files /dev/null and b/wsdls/lib/provided/jaxws-rt-4.0.4.jar differ diff --git a/wsdls/lib/provided/jaxws-tools-2.3.7.jar b/wsdls/lib/provided/jaxws-tools-2.3.7.jar deleted file mode 100644 index a272ad5..0000000 Binary files a/wsdls/lib/provided/jaxws-tools-2.3.7.jar and /dev/null differ diff --git a/wsdls/lib/provided/jaxws-tools-4.0.4.jar b/wsdls/lib/provided/jaxws-tools-4.0.4.jar new file mode 100644 index 0000000..24a5e19 Binary files /dev/null and b/wsdls/lib/provided/jaxws-tools-4.0.4.jar differ diff --git a/wsdls/lib/provided/management-api-3.2.3.jar b/wsdls/lib/provided/management-api-3.2.3.jar deleted file mode 100644 index 22a39b0..0000000 Binary files a/wsdls/lib/provided/management-api-3.2.3.jar and /dev/null differ diff --git a/wsdls/lib/provided/management-api-3.3.0.jar b/wsdls/lib/provided/management-api-3.3.0.jar new file mode 100644 index 0000000..42bc529 Binary files /dev/null and b/wsdls/lib/provided/management-api-3.3.0.jar differ diff --git a/wsdls/lib/provided/mimepull-1.10.0.jar b/wsdls/lib/provided/mimepull-1.10.0.jar new file mode 100644 index 0000000..986a802 Binary files /dev/null and b/wsdls/lib/provided/mimepull-1.10.0.jar differ diff --git a/wsdls/lib/provided/mimepull-1.9.15.jar b/wsdls/lib/provided/mimepull-1.9.15.jar deleted file mode 100644 index 57ff35c..0000000 Binary files a/wsdls/lib/provided/mimepull-1.9.15.jar and /dev/null differ diff --git a/wsdls/lib/provided/pfl-basic-5.1.0.jar b/wsdls/lib/provided/pfl-basic-5.1.0.jar new file mode 100644 index 0000000..99e566a Binary files /dev/null and b/wsdls/lib/provided/pfl-basic-5.1.0.jar differ diff --git a/wsdls/lib/provided/pfl-dynamic-5.1.0.jar b/wsdls/lib/provided/pfl-dynamic-5.1.0.jar new file mode 100644 index 0000000..e8a0b07 Binary files /dev/null and b/wsdls/lib/provided/pfl-dynamic-5.1.0.jar differ diff --git a/wsdls/lib/provided/pfl-tf-5.1.0.jar b/wsdls/lib/provided/pfl-tf-5.1.0.jar new file mode 100644 index 0000000..36c4a0d Binary files /dev/null and b/wsdls/lib/provided/pfl-tf-5.1.0.jar differ diff --git a/wsdls/lib/provided/policy-2.7.10.jar b/wsdls/lib/provided/policy-2.7.10.jar deleted file mode 100644 index 74c1c0f..0000000 Binary files a/wsdls/lib/provided/policy-2.7.10.jar and /dev/null differ diff --git a/wsdls/lib/provided/saaj-impl-1.5.3.jar b/wsdls/lib/provided/saaj-impl-1.5.3.jar deleted file mode 100644 index c915c1c..0000000 Binary files a/wsdls/lib/provided/saaj-impl-1.5.3.jar and /dev/null differ diff --git a/wsdls/lib/provided/saaj-impl-3.0.4.jar b/wsdls/lib/provided/saaj-impl-3.0.4.jar new file mode 100644 index 0000000..15ff325 Binary files /dev/null and b/wsdls/lib/provided/saaj-impl-3.0.4.jar differ diff --git a/wsdls/lib/provided/stax-ex-1.8.3.jar b/wsdls/lib/provided/stax-ex-1.8.3.jar deleted file mode 100644 index cba7bbc..0000000 Binary files a/wsdls/lib/provided/stax-ex-1.8.3.jar and /dev/null differ diff --git a/wsdls/lib/provided/stax-ex-2.1.0.jar b/wsdls/lib/provided/stax-ex-2.1.0.jar new file mode 100644 index 0000000..293ac1e Binary files /dev/null and b/wsdls/lib/provided/stax-ex-2.1.0.jar differ diff --git a/wsdls/lib/provided/streambuffer-1.5.10.jar b/wsdls/lib/provided/streambuffer-1.5.10.jar deleted file mode 100644 index aaac95b..0000000 Binary files a/wsdls/lib/provided/streambuffer-1.5.10.jar and /dev/null differ diff --git a/wsdls/lib/provided/streambuffer-2.1.0.jar b/wsdls/lib/provided/streambuffer-2.1.0.jar new file mode 100644 index 0000000..1d94d93 Binary files /dev/null and b/wsdls/lib/provided/streambuffer-2.1.0.jar differ diff --git a/wsdls/lib/provided/woodstox-core-6.5.1.jar b/wsdls/lib/provided/woodstox-core-6.5.1.jar deleted file mode 100644 index b22b384..0000000 Binary files a/wsdls/lib/provided/woodstox-core-6.5.1.jar and /dev/null differ diff --git a/wsdls/lib/provided/woodstox-core-7.1.1.jar b/wsdls/lib/provided/woodstox-core-7.1.1.jar new file mode 100644 index 0000000..92c1631 Binary files /dev/null and b/wsdls/lib/provided/woodstox-core-7.1.1.jar differ diff --git a/wsdls/readme.txt b/wsdls/readme.txt index afb7580..e69de29 100644 --- a/wsdls/readme.txt +++ b/wsdls/readme.txt @@ -1,57 +0,0 @@ -==================================== -PCEHR B2B WSDL module (wsdls/) -==================================== - -Canonical PCEHR B2B WSDL and XSD for this product live under: - - src/main/resources/wsdl/ - src/main/resources/schema/ - -They are part of the open-source repository (not separate ADHA-licensed -artefacts like Healthcare Identifiers contracts in hi-b2b-client-java). - -==================================== -Default build (mhr-b2b-client-java) -==================================== - -The main Maven build does not run wsimport. SOAP types come from Maven: - - au.gov.nehta:pcehr-compiled-wsdl (pcehr.wsdl.version = project version) - -See repository README.md and CONTRIBUTING.md. - -==================================== -Optional: Ant wsimport (maintainers) -==================================== - -To regenerate Java types locally from the in-repo WSDL tree: - - Prerequisites: JDK 8+, Apache Maven 3.6+, Apache Ant on PATH. - - 1. Refresh tooling (after ee4j.jaxws.version bump): - ./sync-lib.ps1 - or: - mvn -B -f ee4j-jaxws-lib-pom.xml package - - 2. Run wsimport: - ant -f build.xml generate-src - -Tooling JARs: lib/provided/ (Eclipse EE4J jaxws-tools + jaxws-rt + -ant-contrib — not legacy Metro webservices-*). - -Keep ee4j.jaxws.version in ee4j-jaxws-lib-pom.xml aligned with -ee4j.jaxws.version in the repository root pom.xml. - -Offline verification (no Ant run): WsdlsCodegenToolingTest in the main -client test suite. - -Ant build output (gitignored): build/, tmp/, dist/, extern/. - -==================================== -Licensing -==================================== - -Copyright 2012 NEHTA. Copyright 2021-2026 ADHA. - -Licensed under the Apache License, Version 2.0. See LICENSE.txt at the -repository root (and license.txt in this directory for legacy Ant packages). diff --git a/wsdls/revisions.txt b/wsdls/revisions.txt index 991141e..5a687c1 100644 --- a/wsdls/revisions.txt +++ b/wsdls/revisions.txt @@ -1,11 +1,11 @@ 2.4.4 ----- -* modified PCEHR_HealthRecordOverview_Response.xsd new changes for shared health summary (shs) +* modified MHR_HealthRecordOverview_Response.xsd new changes for shared health summary (shs) 2.4.3 ----- -* modified streeNameType to > streetNameType in PCEHR_View_CommonType.xsd +* modified streeNameType to > streetNameType in MHR_View_CommonType.xsd - removed AdvancedCarePlaning and AchievemnetDiary views 2.4.2 diff --git a/wsdls/src/main/java/au/gov/nehta/schema/DateAdapter.java b/wsdls/src/main/java/au/gov/nehta/schema/DateAdapter.java index c39b0a1..41d46ce 100644 --- a/wsdls/src/main/java/au/gov/nehta/schema/DateAdapter.java +++ b/wsdls/src/main/java/au/gov/nehta/schema/DateAdapter.java @@ -3,13 +3,13 @@ import java.text.SimpleDateFormat; import java.util.Calendar; -import javax.xml.bind.annotation.adapters.XmlAdapter; +import jakarta.xml.bind.annotation.adapters.XmlAdapter; public class DateAdapter extends XmlAdapter { public Calendar unmarshal(String value) { - return (javax.xml.bind.DatatypeConverter.parseDate(value)); + return (jakarta.xml.bind.DatatypeConverter.parseDate(value)); } public String marshal(Calendar value) { @@ -20,3 +20,4 @@ public String marshal(Calendar value) { return sdf.format( value.getTime() ); } } + diff --git a/wsdls/src/main/resources/binding/B2B_GetAuditView.wsdl.jxb b/wsdls/src/main/resources/binding/B2B_GetAuditView.wsdl.jxb index 985382b..bc6387b 100644 --- a/wsdls/src/main/resources/binding/B2B_GetAuditView.wsdl.jxb +++ b/wsdls/src/main/resources/binding/B2B_GetAuditView.wsdl.jxb @@ -2,7 +2,7 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - + diff --git a/wsdls/src/main/resources/binding/B2B_PCEHRProfile-1.0.wsdl.jxb b/wsdls/src/main/resources/binding/B2B_MHRProfile-1.0.wsdl.jxb similarity index 82% rename from wsdls/src/main/resources/binding/B2B_PCEHRProfile-1.0.wsdl.jxb rename to wsdls/src/main/resources/binding/B2B_MHRProfile-1.0.wsdl.jxb index 13dff30..85d1595 100644 --- a/wsdls/src/main/resources/binding/B2B_PCEHRProfile-1.0.wsdl.jxb +++ b/wsdls/src/main/resources/binding/B2B_MHRProfile-1.0.wsdl.jxb @@ -3,7 +3,7 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema"> - + diff --git a/wsdls/src/main/resources/binding/B2B_PCEHRProfile.wsdl.jxb b/wsdls/src/main/resources/binding/B2B_MHRProfile.wsdl.jxb similarity index 87% rename from wsdls/src/main/resources/binding/B2B_PCEHRProfile.wsdl.jxb rename to wsdls/src/main/resources/binding/B2B_MHRProfile.wsdl.jxb index ba44fae..ba26800 100644 --- a/wsdls/src/main/resources/binding/B2B_PCEHRProfile.wsdl.jxb +++ b/wsdls/src/main/resources/binding/B2B_MHRProfile.wsdl.jxb @@ -3,7 +3,7 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema"> - + - + - + diff --git a/wsdls/src/main/resources/binding/B2B_RemoveDocument.wsdl.jxb b/wsdls/src/main/resources/binding/B2B_RemoveDocument.wsdl.jxb index 978cfd2..68460b8 100644 --- a/wsdls/src/main/resources/binding/B2B_RemoveDocument.wsdl.jxb +++ b/wsdls/src/main/resources/binding/B2B_RemoveDocument.wsdl.jxb @@ -3,7 +3,7 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema"> - + diff --git a/wsdls/src/main/resources/binding/GlobalBindings.jxb b/wsdls/src/main/resources/binding/GlobalBindings.jxb index f6be5c6..490c5b0 100644 --- a/wsdls/src/main/resources/binding/GlobalBindings.jxb +++ b/wsdls/src/main/resources/binding/GlobalBindings.jxb @@ -22,11 +22,6 @@ name="java.util.Calendar" xmlType="xsd:date" adapter="au.gov.nehta.schema.DateAdapter" /> - diff --git a/wsdls/src/main/resources/binding/PCEHR_CommonTypes.xsd.jxb b/wsdls/src/main/resources/binding/MHR_CommonTypes.xsd.jxb similarity index 97% rename from wsdls/src/main/resources/binding/PCEHR_CommonTypes.xsd.jxb rename to wsdls/src/main/resources/binding/MHR_CommonTypes.xsd.jxb index 996059a..9701209 100644 --- a/wsdls/src/main/resources/binding/PCEHR_CommonTypes.xsd.jxb +++ b/wsdls/src/main/resources/binding/MHR_CommonTypes.xsd.jxb @@ -2,7 +2,7 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - + diff --git a/wsdls/src/main/resources/binding/PCEHR_CommonTypes_Supplementary.xsd.jxb b/wsdls/src/main/resources/binding/MHR_CommonTypes_Supplementary.xsd.jxb similarity index 81% rename from wsdls/src/main/resources/binding/PCEHR_CommonTypes_Supplementary.xsd.jxb rename to wsdls/src/main/resources/binding/MHR_CommonTypes_Supplementary.xsd.jxb index 9b84d62..00be7cb 100644 --- a/wsdls/src/main/resources/binding/PCEHR_CommonTypes_Supplementary.xsd.jxb +++ b/wsdls/src/main/resources/binding/MHR_CommonTypes_Supplementary.xsd.jxb @@ -3,7 +3,7 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema"> - + diff --git a/wsdls/src/main/resources/schema/Common/PCEHR_CommonTypes.xsd b/wsdls/src/main/resources/schema/Common/MHR_CommonTypes.xsd similarity index 100% rename from wsdls/src/main/resources/schema/Common/PCEHR_CommonTypes.xsd rename to wsdls/src/main/resources/schema/Common/MHR_CommonTypes.xsd diff --git a/wsdls/src/main/resources/schema/Common/PCEHR_CommonTypes_Supplementary.xsd b/wsdls/src/main/resources/schema/Common/MHR_CommonTypes_Supplementary.xsd similarity index 99% rename from wsdls/src/main/resources/schema/Common/PCEHR_CommonTypes_Supplementary.xsd rename to wsdls/src/main/resources/schema/Common/MHR_CommonTypes_Supplementary.xsd index 15cb66d..0a995ef 100644 --- a/wsdls/src/main/resources/schema/Common/PCEHR_CommonTypes_Supplementary.xsd +++ b/wsdls/src/main/resources/schema/Common/MHR_CommonTypes_Supplementary.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/schema/Common/PCEHR_TemplatesTypes.xsd b/wsdls/src/main/resources/schema/Common/MHR_TemplatesTypes.xsd similarity index 100% rename from wsdls/src/main/resources/schema/Common/PCEHR_TemplatesTypes.xsd rename to wsdls/src/main/resources/schema/Common/MHR_TemplatesTypes.xsd diff --git a/wsdls/src/main/resources/schema/External/PCEHR_DoesPCEHRExist.xsd b/wsdls/src/main/resources/schema/External/MHR_DoesMHRExist.xsd similarity index 93% rename from wsdls/src/main/resources/schema/External/PCEHR_DoesPCEHRExist.xsd rename to wsdls/src/main/resources/schema/External/MHR_DoesMHRExist.xsd index 5e8f2e9..e7f1d61 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_DoesPCEHRExist.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_DoesMHRExist.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_GainPCEHRAccess.xsd b/wsdls/src/main/resources/schema/External/MHR_GainMHRAccess.xsd similarity index 97% rename from wsdls/src/main/resources/schema/External/PCEHR_GainPCEHRAccess.xsd rename to wsdls/src/main/resources/schema/External/MHR_GainMHRAccess.xsd index 3e828bf..df65fb9 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_GainPCEHRAccess.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_GainMHRAccess.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_GetAuditView.xsd b/wsdls/src/main/resources/schema/External/MHR_GetAuditView.xsd similarity index 97% rename from wsdls/src/main/resources/schema/External/PCEHR_GetAuditView.xsd rename to wsdls/src/main/resources/schema/External/MHR_GetAuditView.xsd index f36039b..79e4ab5 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_GetAuditView.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_GetAuditView.xsd @@ -1,7 +1,7 @@ - + Comment describing your root element diff --git a/wsdls/src/main/resources/schema/External/PCEHR_GetChangeHistoryView.xsd b/wsdls/src/main/resources/schema/External/MHR_GetChangeHistoryView.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/PCEHR_GetChangeHistoryView.xsd rename to wsdls/src/main/resources/schema/External/MHR_GetChangeHistoryView.xsd diff --git a/wsdls/src/main/resources/schema/External/PCEHR_GetIndividualDetailsView.xsd b/wsdls/src/main/resources/schema/External/MHR_GetIndividualDetailsView.xsd similarity index 95% rename from wsdls/src/main/resources/schema/External/PCEHR_GetIndividualDetailsView.xsd rename to wsdls/src/main/resources/schema/External/MHR_GetIndividualDetailsView.xsd index ce6ee35..d2a7984 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_GetIndividualDetailsView.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_GetIndividualDetailsView.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_GetRepresentativeList.xsd b/wsdls/src/main/resources/schema/External/MHR_GetRepresentativeList.xsd similarity index 95% rename from wsdls/src/main/resources/schema/External/PCEHR_GetRepresentativeList.xsd rename to wsdls/src/main/resources/schema/External/MHR_GetRepresentativeList.xsd index cdcfdba..ead648e 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_GetRepresentativeList.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_GetRepresentativeList.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_GetTemplate.xsd b/wsdls/src/main/resources/schema/External/MHR_GetTemplate.xsd similarity index 92% rename from wsdls/src/main/resources/schema/External/PCEHR_GetTemplate.xsd rename to wsdls/src/main/resources/schema/External/MHR_GetTemplate.xsd index c233e63..f11cf02 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_GetTemplate.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_GetTemplate.xsd @@ -1,8 +1,8 @@ - - + + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_GetView.xsd b/wsdls/src/main/resources/schema/External/MHR_GetView.xsd similarity index 80% rename from wsdls/src/main/resources/schema/External/PCEHR_GetView.xsd rename to wsdls/src/main/resources/schema/External/MHR_GetView.xsd index b45ec3b..97248eb 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_GetView.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_GetView.xsd @@ -39,17 +39,17 @@ xmlns:hro="http://ns.electronichealth.net.au/pcehr/xsd/interfaces/HealthRecordOv xmlns:prv="http://ns.electronichealth.net.au/pcehr/xsd/interfaces/PathologyReportView/1.0" > - - - - - - - - - - - + + + + + + + + + + + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_RegisterPCEHR.xsd b/wsdls/src/main/resources/schema/External/MHR_RegisterMHR.xsd similarity index 98% rename from wsdls/src/main/resources/schema/External/PCEHR_RegisterPCEHR.xsd rename to wsdls/src/main/resources/schema/External/MHR_RegisterMHR.xsd index 38b8ff1..a1ad617 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_RegisterPCEHR.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_RegisterMHR.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_RemoveDocument.xsd b/wsdls/src/main/resources/schema/External/MHR_RemoveDocument.xsd similarity index 93% rename from wsdls/src/main/resources/schema/External/PCEHR_RemoveDocument.xsd rename to wsdls/src/main/resources/schema/External/MHR_RemoveDocument.xsd index a71942c..b623aab 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_RemoveDocument.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_RemoveDocument.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/schema/External/PCEHR_SearchTemplate.xsd b/wsdls/src/main/resources/schema/External/MHR_SearchTemplate.xsd similarity index 90% rename from wsdls/src/main/resources/schema/External/PCEHR_SearchTemplate.xsd rename to wsdls/src/main/resources/schema/External/MHR_SearchTemplate.xsd index b34dea4..52375fa 100644 --- a/wsdls/src/main/resources/schema/External/PCEHR_SearchTemplate.xsd +++ b/wsdls/src/main/resources/schema/External/MHR_SearchTemplate.xsd @@ -1,8 +1,8 @@ - - + + diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_DiagnosticImagingReportView.xsd b/wsdls/src/main/resources/schema/External/View/MHR_DiagnosticImagingReportView.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/View/PCEHR_DiagnosticImagingReportView.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_DiagnosticImagingReportView.xsd diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_DiagnosticImagingReportView_Response.xsd b/wsdls/src/main/resources/schema/External/View/MHR_DiagnosticImagingReportView_Response.xsd similarity index 95% rename from wsdls/src/main/resources/schema/External/View/PCEHR_DiagnosticImagingReportView_Response.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_DiagnosticImagingReportView_Response.xsd index 7146cd3..95676d7 100644 --- a/wsdls/src/main/resources/schema/External/View/PCEHR_DiagnosticImagingReportView_Response.xsd +++ b/wsdls/src/main/resources/schema/External/View/MHR_DiagnosticImagingReportView_Response.xsd @@ -1,8 +1,8 @@ - - + + diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_HealthCheckScheduleView.xsd b/wsdls/src/main/resources/schema/External/View/MHR_HealthCheckScheduleView.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/View/PCEHR_HealthCheckScheduleView.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_HealthCheckScheduleView.xsd diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_HealthRecordOverview.xsd b/wsdls/src/main/resources/schema/External/View/MHR_HealthRecordOverview.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/View/PCEHR_HealthRecordOverview.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_HealthRecordOverview.xsd diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_HealthRecordOverview_Response.xsd b/wsdls/src/main/resources/schema/External/View/MHR_HealthRecordOverview_Response.xsd similarity index 98% rename from wsdls/src/main/resources/schema/External/View/PCEHR_HealthRecordOverview_Response.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_HealthRecordOverview_Response.xsd index 188d37d..4082c24 100644 --- a/wsdls/src/main/resources/schema/External/View/PCEHR_HealthRecordOverview_Response.xsd +++ b/wsdls/src/main/resources/schema/External/View/MHR_HealthRecordOverview_Response.xsd @@ -1,8 +1,8 @@ - - + + diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_MedicareOverview.xsd b/wsdls/src/main/resources/schema/External/View/MHR_MedicareOverview.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/View/PCEHR_MedicareOverview.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_MedicareOverview.xsd diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_ObservationView.xsd b/wsdls/src/main/resources/schema/External/View/MHR_ObservationView.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/View/PCEHR_ObservationView.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_ObservationView.xsd diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_PathologyReportView.xsd b/wsdls/src/main/resources/schema/External/View/MHR_PathologyReportView.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/View/PCEHR_PathologyReportView.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_PathologyReportView.xsd diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_PathologyReportView_Response.xsd b/wsdls/src/main/resources/schema/External/View/MHR_PathologyReportView_Response.xsd similarity index 94% rename from wsdls/src/main/resources/schema/External/View/PCEHR_PathologyReportView_Response.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_PathologyReportView_Response.xsd index f13bddf..92ec7c2 100644 --- a/wsdls/src/main/resources/schema/External/View/PCEHR_PathologyReportView_Response.xsd +++ b/wsdls/src/main/resources/schema/External/View/MHR_PathologyReportView_Response.xsd @@ -1,8 +1,8 @@ - - + + diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_PrescriptionAndDispenseView.xsd b/wsdls/src/main/resources/schema/External/View/MHR_PrescriptionAndDispenseView.xsd similarity index 100% rename from wsdls/src/main/resources/schema/External/View/PCEHR_PrescriptionAndDispenseView.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_PrescriptionAndDispenseView.xsd diff --git a/wsdls/src/main/resources/schema/External/View/PCEHR_View_CommonType.xsd b/wsdls/src/main/resources/schema/External/View/MHR_View_CommonType.xsd similarity index 98% rename from wsdls/src/main/resources/schema/External/View/PCEHR_View_CommonType.xsd rename to wsdls/src/main/resources/schema/External/View/MHR_View_CommonType.xsd index afb7d41..055d46c 100644 --- a/wsdls/src/main/resources/schema/External/View/PCEHR_View_CommonType.xsd +++ b/wsdls/src/main/resources/schema/External/View/MHR_View_CommonType.xsd @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_DocumentRegistry.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_DocumentRegistry.wsdl index f46260f..41af9e8 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_DocumentRegistry.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_DocumentRegistry.wsdl @@ -19,7 +19,7 @@ code generating toolkits to work properly --> - + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_DocumentRepository.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_DocumentRepository.wsdl index 4e963ce..a34e89c 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_DocumentRepository.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_DocumentRepository.wsdl @@ -9,7 +9,7 @@ - + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_GetAuditViewInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_GetAuditViewInterface.wsdl index b5eff12..7b85e47 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_GetAuditViewInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_GetAuditViewInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_GetChangeHistoryViewInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_GetChangeHistoryViewInterface.wsdl index b7146d9..67b96f7 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_GetChangeHistoryViewInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_GetChangeHistoryViewInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_GetIndividualDetailsViewInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_GetIndividualDetailsViewInterface.wsdl index fcea823..1b18aa8 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_GetIndividualDetailsViewInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_GetIndividualDetailsViewInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_GetRepresentativeListInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_GetRepresentativeListInterface.wsdl index 788ba3b..af30ebe 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_GetRepresentativeListInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_GetRepresentativeListInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_GetTemplateInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_GetTemplateInterface.wsdl index da4f40f..cc554f7 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_GetTemplateInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_GetTemplateInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_GetViewInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_GetViewInterface.wsdl index 06f20e2..8ec2270 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_GetViewInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_GetViewInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_PCEHRProfile.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_MHRProfile.wsdl similarity index 97% rename from wsdls/src/main/resources/wsdl/External/B2B_PCEHRProfile.wsdl rename to wsdls/src/main/resources/wsdl/External/B2B_MHRProfile.wsdl index 3ff99e1..e8e2411 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_PCEHRProfile.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_MHRProfile.wsdl @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_PCEHRProfileInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_MHRProfileInterface.wsdl similarity index 97% rename from wsdls/src/main/resources/wsdl/External/B2B_PCEHRProfileInterface.wsdl rename to wsdls/src/main/resources/wsdl/External/B2B_MHRProfileInterface.wsdl index 983699c..a9a63e9 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_PCEHRProfileInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_MHRProfileInterface.wsdl @@ -3,9 +3,9 @@ - - - + + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_RegisterPCEHR.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_RegisterMHR.wsdl similarity index 97% rename from wsdls/src/main/resources/wsdl/External/B2B_RegisterPCEHR.wsdl rename to wsdls/src/main/resources/wsdl/External/B2B_RegisterMHR.wsdl index f8e240d..fdd7a8b 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_RegisterPCEHR.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_RegisterMHR.wsdl @@ -1,7 +1,7 @@ - + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_RegisterPCEHRInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_RegisterMHRInterface.wsdl similarity index 97% rename from wsdls/src/main/resources/wsdl/External/B2B_RegisterPCEHRInterface.wsdl rename to wsdls/src/main/resources/wsdl/External/B2B_RegisterMHRInterface.wsdl index 4669e13..53425da 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_RegisterPCEHRInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_RegisterMHRInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_RemoveDocumentInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_RemoveDocumentInterface.wsdl index d644425..2475601 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_RemoveDocumentInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_RemoveDocumentInterface.wsdl @@ -3,8 +3,8 @@ - - + + diff --git a/wsdls/src/main/resources/wsdl/External/B2B_SearchTemplateInterface.wsdl b/wsdls/src/main/resources/wsdl/External/B2B_SearchTemplateInterface.wsdl index 5f9fd7f..b3cca2d 100644 --- a/wsdls/src/main/resources/wsdl/External/B2B_SearchTemplateInterface.wsdl +++ b/wsdls/src/main/resources/wsdl/External/B2B_SearchTemplateInterface.wsdl @@ -3,8 +3,8 @@ - - + +