pub fn new(sample_data: &SampleData, resource_type: String) -> SampleResourceIter {
        // We "cheat" a bit here for some resource types, as we know that Synthea will ensure that all
        // unique instances of them land in a specific file.
        let sample_files = match resource_type.as_str() {
            "Organization" => vec![sample_data.hospitals.clone()],
            _ => {
                let mut sample_files = vec![
                    sample_data.hospitals.clone(),
                    sample_data.practitioners.clone(),
                ];
                sample_files.append(&mut sample_data.patients.clone());
                sample_files
            }
        };

        SampleResourceIter {
            sample_files, // Fun note: we'll consume the files backwards. Whatever.
            resource_type,
            sample_resources: None,
            source_ids: HashSet::new(),
        }
    }
/// Creates a new [SampleResourceIter] from the specified [SampleData].
///
/// Parameters:
/// * `logger`: send log events here
/// * `sample_data`: the [SampleData] to extract resources from
/// * `resource_type`: the name of the FHIR resource type to extract
Creates a new [SampleResourceIter] from the specified [SampleData].
Creates a new [ SampleResourceIter ] from the specified [ SampleData ] .
pub fn new(sample_data: &SampleData, resource_type: String) -> SampleResourceIter {
        // We "cheat" a bit here for some resource types, as we know that Synthea will ensure that all
        // unique instances of them land in a specific file.
        let sample_files = match resource_type.as_str() {
            "Organization" => vec![sample_data.hospitals.clone()],
            _ => {
                let mut sample_files = vec![
                    sample_data.hospitals.clone(),
                    sample_data.practitioners.clone(),
                ];
                sample_files.append(&mut sample_data.patients.clone());
                sample_files
            }
        };
        SampleResourceIter {
            sample_files, // Fun note: we'll consume the files backwards. Whatever.
            resource_type,
            sample_resources: None,
            source_ids: HashSet::new(),
        }
    }
pub fn new ( sample_data : & SampleData , resource_type : String ) -> SampleResourceIter { // We "cheat" a bit here for some resource types, as we know that Synthea will ensure that all // unique instances of them land in a specific file. let sample_files = match resource_type . as_str ( ) { " " => vec ! [ sample_data hospitals clone ( ) ] , _ => { let mut sample_files = vec ! [ sample_data hospitals clone ( ) sample_data practitioners clone ( ) ] ; sample_files . append ( & mut sample_data . patients . clone ( ) ) ; sample_files } } ; SampleResourceIter { sample_files , // Fun note: we'll consume the files backwards. Whatever. resource_type , sample_resources : None , source_ids : HashSet :: new ( ) , } }
Creates a new [SampleResourceIter] from the specified [SampleData].
Creates a new [ SampleResourceIter ] from the specified [ SampleData ] .
sample_data
&SampleData
resource_type
String
sample_data
&SampleData
resource_type
String