If you are asking “How to map your database data to Patient FHIR structure” you can take a look at Patient resource details (“https://www.hl7.org/fhir/patient.html”). It gives you plenty of information about “What” should be considered a Patient resource and “How” to interpret it.
It also shows how to map Patients to other well-know formats and structures on clinical documents (https://www.hl7.org/fhir/patient-mappings.html).
If you are asking “How to persist Patient, and other resources, structures” you can use a lot of technologies. SQL, NoSQL, JSON Databases (as MongoDB), JPA… Take a look at (https://www.health-samurai.io/fhirbase). It is a framework who implements a lot of helpful procedures.
One approach to convert data is to implement Adapters (https://en.wikipedia.org/wiki/Adapter_pattern), from your MySQL database structure to the Patient FHIR structure. Example:
MyPatient.name -> Patient.name.text
DateFormat(MyPatient.birthdate) -> Patient.birthDate
- And so on…
FHIR is a standard for health care data exchange, it needs to cover plenty of use cases along with a huge variety of clinical standards. You should identify your needs.
Also, take a look at Extensions (https://www.hl7.org/fhir/extensibility.html). It helps you to cover attributes non-canonicals to FHIR structure.
I could not 100% understand your question, so I wish I could help you.