Maintain provider notes¶
clsNote maintains a general-purpose note row that can be attached to a provider, provider location, bill, or claim through optional foreign-key fields, categorized by a note type/category code pair.
| Field | Value |
|---|---|
| Operation ID | OP-PRV-12 |
| Trigger | Caller calls NewCbpNote/GetCbpNote, edits properties, and calls Save() or Delete() |
| Inputs | ProviderLocationSeqNum (create-time), NoteTypeCode, NoteCategoryCode, ActiveFlag, optional BillID/ClaimID/ProviderSeqNum/ProviderLocationSeqNum, NoteTxt |
| Outputs | Persisted CBP_NOTE row |
| Primary components | clsNote.Create, BeforeInsert/BeforeUpdate/BeforeDelete |
| Entry point | Business\SAIF.Business.Provider\clsNote.vb |
Steps¶
- Create.
NewCbpNote(inDataportal, inProviderLocSeqNum): ifProviderLocationSeqNum > 0,Create()assigns a new seq num viaGetNextSeqNum("CBP_NOTE_SEQ"); otherwise it uses the criteria's note seq num directly.m_CreateUser/m_CreateDateare stamped, but the provider location seq num itself is not copied onto the object during create — it must be set explicitly before save.* - Retrieve. Reads CBP_NOTE joined to
CBP_NOTE_TYPE_CODE(NOTE_TYPE_CODE = CODEandNOTE_CATEGORY_CODE = CBP_NOTE_CATEGORY_CODE) byCBP_NOTE_SEQ_NUM(SQL-041), also readingPROVIDER_CONTACT_NOTE_FLAG AS ContactNoteFlagto deriveIsContactNote. - Validate before save (BR-015):
CommonBusinessRules.TextRequiredonNoteTypeCode:"Error: Missing Type."CommonBusinessRules.TextRequiredonNoteTxt:"Error: Missing note."- Insert. Writes
CBP_NOTE_SEQ_NUM,NOTE_TYPE_CODE,NOTE_CATEGORY_CODE,ACTIVE_FLAG,CREATE_DATE/CREATE_USER,UPDATE_NUM, optionalBILL_ID/CLAIM_ID/PROVIDER_SEQ_NUM/PROVIDER_LOCATION_SEQ_NUM, andNOTE_TXTto CBP_NOTE (SQL-017). - On a rows-affected value other than
1: add"Insert Failed". - Update. Writes type/category/active flag,
UPDATE_DATE/UPDATE_USER,UPDATE_NUM = UPDATE_NUM + 1, and the optional foreign keys and note text to CBP_NOTE (SQL-065) with concurrency checkWHERE CBP_NOTE_SEQ_NUM = :CbpNoteSeqNum AND UPDATE_NUM = :UpdateNum. - On a rows-affected value other than
1: add the DB contention error; otherwise incrementm_UpdateNumandMarkOld(). - Delete. Deletes the CBP_NOTE row by
CBP_NOTE_SEQ_NUMandUPDATE_NUM(SQL-087). - On a rows-affected value other than
1: add the DB contention error; otherwiseMarkNew().
Process flow¶
flowchart TD
Start([Caller edits note]) --> TypeCheck{Note type entered?}
TypeCheck -->|No| Fail([Missing type<br>or text blocks save])
TypeCheck -->|Yes| TextCheck{Note text entered?}
TextCheck -->|No| Fail
TextCheck -->|Yes| Persist[Insert/update/delete CBP_NOTE]
Persist --> Rows{RowsAffected = 1?}
Rows -->|No| Contention([Insert Failed / DB contention error])
Rows -->|Yes| Done([Save complete])
Failure and edge-case behavior¶
Create()does not copy the provider location seq num from the criteria onto the note object, so callers creating a location-scoped note must set that field explicitly before save or the association will be lost.*IsContactNoteis entirely derived from the joinedCBP_NOTE_TYPE_CODE.PROVIDER_CONTACT_NOTE_FLAG, not stored on the note row itself.- Delete, unlike
clsProviderLocation's delete path, does enforceUPDATE_NUMconcurrency.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Business\SAIF.Business.Provider\clsNote.vb