gudmed-trios
v1.0.0
Published
Shared MediEcho audio recording, digitization, and eRx processing for Gudmed portals
Readme
@gudmed/audio-erx
Standalone npm package for MediEcho audio features shared across Gudmed portals (Doctor, Patient, Admin, etc.).
Architecture
┌─────────────────────────────────────────────────────────────┐
│ @gudmed/audio-erx (this package — publish once) │
│ AudioInput · AudioDigitization · ProcessingPage · routes │
└──────────────────────────┬──────────────────────────────────┘
│ imports
▼
┌─────────────────────────────────────────────────────────────┐
│ @gudmed/audio-erx-bindings (each portal provides this) │
│ jwtAxios · Redux actions · ToasterMsg · constants │
└─────────────────────────────────────────────────────────────┘The package holds shared UI and logic. Each portal provides a bindings file that connects the package to that portal's API, Redux, and components.
Publish & update workflow
# 1. Change code in gudmed-audio-erx
cd gudmed-audio-erx
npm run build
# 2. Bump version (semver)
npm version patch # 1.0.0 → 1.0.1 (bug fix)
# npm version minor # 1.0.0 → 1.1.0 (new feature)
# npm version major # 1.0.0 → 2.0.0 (breaking change)
# 3. Publish to your private registry
npm publish
# 4. In each portal — pull the new version
cd ../gudmed_doctorportal
npm update @gudmed/audio-erx
# or pin: npm install @gudmed/[email protected]All portals that depend on @gudmed/audio-erx get the update after npm update and a rebuild/restart.
Local development (before publish)
Link the package from a sibling folder:
// portal package.json
"@gudmed/audio-erx": "file:../gudmed-audio-erx"cd gudmed-audio-erx && npm install && npm run build
cd ../gudmed_doctorportal && npm install --legacy-peer-depsAfter package changes: npm run build in gudmed-audio-erx, then restart the portal dev server.
Setup in a new portal
1. Install the package
npm install @gudmed/[email protected] --legacy-peer-depsOr from local path during development:
"@gudmed/audio-erx": "file:../gudmed-audio-erx"2. Create bindings
Copy bindings.example.js → src/audioErxBindings/index.js and wire your portal's exports.
See Doctor Portal src/audioErxBindings/index.js for a full working example.
3. Vite config
import path from 'path';
export default defineConfig({
resolve: {
alias: {
'@gudmed/audio-erx-bindings': path.resolve(
__dirname,
'src/audioErxBindings',
),
},
dedupe: ['react', 'react-dom'],
},
optimizeDeps: {
include: ['@gudmed/audio-erx'],
},
});Do not alias @gudmed/audio-erx to source — resolve it from node_modules (built dist/).
4. Use in routes and components
import {
AudioInput,
AudioProcessConfig,
audiodigitizationConfig,
} from '@gudmed/audio-erx';
// Routes (modules/index.jsx)
const routeConfigs = [
...AudioProcessConfig,
...audiodigitizationConfig,
];
// Component
<AudioInput opendialog={open} onDeny={setOpen} details={patientDetails} />Publishing options
| Method | package.json | Best for |
|--------|--------------|----------|
| Private npm registry | "@gudmed/audio-erx": "^1.0.0" | Production teams |
| GitHub Packages | Set publishConfig.registry | GitHub org |
| Azure Artifacts | Org npm feed URL | Azure DevOps |
| Local file | "file:../gudmed-audio-erx" | Local dev only |
| Git URL | "git+https://github.com/org/gudmed-audio-erx.git#v1.0.1" | No registry |
GitHub Packages example
# .npmrc in gudmed-audio-erx and each portal
@gudmed:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_TOKEN// gudmed-audio-erx/package.json
"publishConfig": {
"registry": "https://npm.pkg.github.com"
}Exports
| Export | Description |
|--------|-------------|
| AudioInput | Record/upload audio dialog |
| FileUploader | Drag-and-drop audio upload |
| PatientBannerCard | Patient info banner in audio dialog |
| AudioProcessConfig | Route config for /PresProcessingPage |
| audiodigitizationConfig | Route config for /audiodigitization |
| ProcessingPage | Full prescription processing screen |
| AudioDigitization | Audio eRx pending list page |
| CustomAudioPlayer | Multi-track audio player |
| PdfViewer | eRx PDF preview/send dialog |
Versioning rules
- patch — bug fixes, styling (1.0.0 → 1.0.1)
- minor — new props, non-breaking features (1.0.0 → 1.1.0)
- major — breaking bindings changes, removed exports (1.0.0 → 2.0.0)
If you add a new binding export that portals must provide, document it in bindings.example.js and bump minor or major.
