Carries information about a staff member's professional affiliations such as medical societies and specialty boards, including the organization name, address, and membership dates. It follows STF in MFN staff master file messages and is used by credentialing and provider enrollment systems to maintain a record of professional memberships.
from zato.hl7v2.v2_9 import AFF
from zato.hl7v2.v2_9 import XCN, CWE, DIN
aff = AFF()
aff.primary_key_value_aff = '1'
aff.professional_affiliation_id = XCN(
person_identifier_type='NPI',
id_number='1234567890',
family_name='Johnson',
given_name='Sarah'
)
organization = XCN(organization_name='American College of Sports Medicine')
aff.professional_organization = organization
aff.affiliation_type = CWE(
identifier='MEM',
text='Member',
name_of_coding_system='HL70427'
)
aff.affiliation_date_range = DIN('20200101-20251231')How to construct and work with real-world AFF segments.
Professional affiliation with sports medicine organization
from zato.hl7v2.v2_9 import AFF
from zato.hl7v2.v2_9 import XCN, CWE, DIN
aff = AFF()
aff.primary_key_value_aff = '1'
aff.professional_affiliation_id = XCN(
person_identifier_type='NPI',
id_number='1234567890',
family_name='Johnson',
given_name='Sarah'
)
aff.professional_organization = XCN(organization_name='American College of Sports Medicine')
aff.affiliation_type = CWE(
identifier='MEM',
text='Member',
name_of_coding_system='HL70427'
)
aff.affiliation_date_range = DIN('20200101-20251231')
aff.affiliation_comment = 'Active member in sports medicine'Board certification in clinical nutrition practice
from zato.hl7v2.v2_9 import AFF
from zato.hl7v2.v2_9 import XCN, CWE, DIN
aff = AFF()
aff.primary_key_value_aff = '2'
aff.professional_affiliation_id = XCN(
person_identifier_type='NPI',
id_number='5551112222',
family_name='Chen',
given_name='Lisa'
)
aff.professional_organization = XCN(organization_name='American Board of Nutrition Specialists')
aff.affiliation_type = CWE(
identifier='CERT',
text='Certified',
name_of_coding_system='HL70427'
)
aff.affiliation_date_range = DIN('20180615-20250614')
aff.affiliation_comment = 'Board certified clinical nutritionist'University faculty position in preventive medicine
from zato.hl7v2.v2_9 import AFF
from zato.hl7v2.v2_9 import XCN, CWE, DIN
aff = AFF()
aff.primary_key_value_aff = '3'
aff.professional_affiliation_id = XCN(
person_identifier_type='NPI',
id_number='9876543210',
family_name='Miller',
given_name='Michael'
)
aff.professional_organization = XCN(organization_name='University of Colorado School of Medicine')
aff.affiliation_type = CWE(
identifier='FAC',
text='Faculty',
name_of_coding_system='HL70427'
)
aff.affiliation_date_range = DIN('20200901-20240831')
aff.affiliation_comment = 'Assistant professor of preventive medicine'Step-by-step guides for working with HL7 v2 in Zato.
AFF records professional affiliations including memberships, certifications, academic appointments, and professional relationships. It's used to track provider credentials and organizational relationships in wellness programs.
Use HL70427 table values for affiliation types like MEM (Member), CERT (Certified), or FAC (Faculty):
aff.affiliation_type = CWE(
identifier='MEM',
text='Member',
name_of_coding_system='HL70427'
)professional_affiliation_id identifies the person with their credentials, while professional_organization identifies the professional organization or institution. Both use XCN datatype but represent different entities.
Use DIN datatype with YYYYMMDD-YYYYMMDD format for date ranges:
aff.affiliation_date_range = DIN('20200101-20251231')
# or for single dates
aff.affiliation_date_range = DIN('20200101')Include details about the nature of the affiliation, specific roles or titles, certification levels, or other relevant professional information that helps understand the provider's credentials and expertise.
Zato connects to any system that speaks HL7v2 over MLLP or FHIR over REST. This includes Epic, Cerner, Meditech, Allscripts, and other EHR platforms.
Yes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically.
Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. Standard segments and datatypes are available as typed Python classes.
Yes. Zato handles both HL7v2 and FHIR natively, so you can parse v2 messages and build FHIR resources with IG-specific extensions in the same service. Typed Python classes are available for both protocols, including extensions from US Core, UK Core, Da Vinci, and other Implementation Guides.
Complete list of fields in the AFF segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_aff | SI | Required | No | - |
| 2 | professional_organization | XON | Required | No | - |
| 3 | professional_organization_address | XAD | Optional | No | - |
| 4 | professional_organization_affiliation_date_range | DR | Optional | Yes | - |
| 5 | professional_affiliation_additional_information | ST | Optional | No | - |
Get started with Zato and connect your systems in minutes.